]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
timedatectl: stop using _fallthrough_ 41458/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Wed, 25 Mar 2026 23:04:34 +0000 (00:04 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Fri, 3 Apr 2026 11:07:04 +0000 (13:07 +0200)
gcc and newer clang seem to be fine with it, but clang 14, 16, 18
is unhappy:
  ../src/timedate/timedatectl.c:1006:25: error: fallthrough annotation does not directly precede switch label
                        _fallthrough_;
                        ^
_fallthrough_ doesn't seem to be used very often in option parsing,
so let's remove the use for now.

src/timedate/timedatectl.c

index 75c142e84ec58d2a40df13e90856901c3c10ece3..7d6ca7450a6be165c5f51c25042f63f8cc869966 100644 (file)
@@ -995,9 +995,9 @@ static int parse_argv(int argc, char *argv[], char ***ret_args) {
                         /* If the user asked for a particular property, show it to them, even if empty. */
                         SET_FLAG(arg_print_flags, BUS_PRINT_PROPERTY_SHOW_EMPTY, true);
 
-                        if (current->short_code == 'p')
-                                break;
-                        _fallthrough_;
+                        if (current->short_code == 'P')
+                                SET_FLAG(arg_print_flags, BUS_PRINT_PROPERTY_ONLY_VALUE, true);
+                        break;
 
                 OPTION_LONG("value", NULL, "When showing properties, only print the value"):
                         SET_FLAG(arg_print_flags, BUS_PRINT_PROPERTY_ONLY_VALUE, true);