aboutsummaryrefslogtreecommitdiff
path: root/2025-linuxdays/warn-switch.c
diff options
context:
space:
mode:
Diffstat (limited to '2025-linuxdays/warn-switch.c')
-rw-r--r--2025-linuxdays/warn-switch.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/2025-linuxdays/warn-switch.c b/2025-linuxdays/warn-switch.c
new file mode 100644
index 0000000..0de8859
--- /dev/null
+++ b/2025-linuxdays/warn-switch.c
@@ -0,0 +1,14 @@
+#include <stdio.h>
+
+int main(int argc, char *argv[]) {
+ int val = getchar();
+ switch (val) {
+ case ' ':
+ printf("Secret space.. ");
+ [[gnu::fallthrough]];
+ default:
+ printf("Got: '%c'\n", val);
+ break;
+ }
+ return 0;
+}