]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tree-wide: adjust fall through comments so that gcc is happy
authorShawn Landden <slandden@gmail.com>
Sun, 19 Nov 2017 18:06:10 +0000 (10:06 -0800)
committerShawn Landden <slandden@gmail.com>
Mon, 20 Nov 2017 21:06:25 +0000 (13:06 -0800)
Distcc removes comments, making the comment silencing
not work.

I know there was a decision against a macro in commit
ec251fe7d5bc24b5d38b0853bc5969f3a0ba06e2

43 files changed:
src/basic/MurmurHash2.c
src/basic/generate-gperfs.py
src/basic/macro.h
src/basic/siphash24.c
src/basic/time-util.c
src/core/job.c
src/core/load-fragment-gperf.gperf.m4
src/core/main.c
src/core/manager.c
src/core/namespace.c
src/core/service.c
src/core/shutdown.c
src/core/socket.c
src/core/timer.c
src/journal-remote/journal-upload-journal.c
src/journal/journal-file.c
src/journal/journald-gperf.gperf
src/journal/journald-syslog.c
src/libsystemd-network/sd-dhcp-client.c
src/libsystemd-network/sd-dhcp6-client.c
src/libsystemd-network/sd-ipv4acd.c
src/libsystemd/sd-bus/bus-message.c
src/libsystemd/sd-bus/bus-objects.c
src/libsystemd/sd-device/sd-device.c
src/libsystemd/sd-id128/id128-util.c
src/login/logind-gperf.gperf
src/network/netdev/netdev-gperf.gperf
src/network/networkd-address.c
src/network/networkd-dhcp6.c
src/network/networkd-gperf.gperf
src/network/networkd-network-gperf.gperf
src/nspawn/nspawn-gperf.gperf
src/nspawn/nspawn.c
src/resolve/generate-dns_type-gperf.py
src/resolve/resolved-gperf.gperf
src/shared/machine-image.c
src/timesync/timesyncd-gperf.gperf
src/tmpfiles/tmpfiles.c
src/udev/generate-keyboard-keys-gperf.sh
src/udev/net/link-config-gperf.gperf
src/udev/net/link-config.c
src/udev/scsi_id/scsi_serial.c
src/udev/udev-rules.c

index a282a212014e7853abfa72b9823c2956d4df0096..47adfb4d0a3c79256990f38219020ca44f782299 100644 (file)
 
 #include "MurmurHash2.h"
 
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
+
 //-----------------------------------------------------------------------------
 // Platform-specific functions and macros
 
index d4cc9aa45c29530c35dfa5f579b596ae12b1478d..aca9ab1fe91e3123ac3a99355efb699d715283de 100755 (executable)
@@ -7,6 +7,12 @@ import sys
 
 name, prefix, input = sys.argv[1:]
 
+print("""\
+%{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \\"-Wimplicit-fallthrough\\"")
+#endif
+%}""")
 print("""\
 struct {}_name {{ const char* name; int id; }};
 %null-strings
index 13652fb94dbc706f94d890e4dad3b2cee79c92c0..2c6e46b6c83bfbbeb4e83cf4e2d1cf9a056c535d 100644 (file)
@@ -48,6 +48,7 @@
 #define _weakref_(x) __attribute__((weakref(#x)))
 #define _alignas_(x) __attribute__((aligned(__alignof(x))))
 #define _cleanup_(x) __attribute__((cleanup(x)))
+#define _fallthrough_ __attribute__((fallthrough))
 
 /* Temporarily disable some warnings */
 #define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT                     \
index 4bb41786c8b2a27b224ca9b9a0a682bde50e6fb8..d3a81b7cc16ecaf52a68d1f89e613bb74c730fcf 100644 (file)
@@ -127,25 +127,25 @@ void siphash24_compress(const void *_in, size_t inlen, struct siphash *state) {
         switch (left) {
                 case 7:
                         state->padding |= ((uint64_t) in[6]) << 48;
-                        /* fall through */
+                        _fallthrough_;
                 case 6:
                         state->padding |= ((uint64_t) in[5]) << 40;
-                        /* fall through */
+                        _fallthrough_;
                 case 5:
                         state->padding |= ((uint64_t) in[4]) << 32;
-                        /* fall through */
+                        _fallthrough_;
                 case 4:
                         state->padding |= ((uint64_t) in[3]) << 24;
-                        /* fall through */
+                        _fallthrough_;
                 case 3:
                         state->padding |= ((uint64_t) in[2]) << 16;
-                        /* fall through */
+                        _fallthrough_;
                 case 2:
                         state->padding |= ((uint64_t) in[1]) <<  8;
-                        /* fall through */
+                        _fallthrough_;
                 case 1:
                         state->padding |= ((uint64_t) in[0]);
-                        /* fall through */
+                        _fallthrough_;
                 case 0:
                         break;
         }
index f5af3281a100b9d6f66cab5335695fe8728de681..bd5a6ae613b941ca2345bba4f70a62a0a3fdfbe5 100644 (file)
@@ -1382,8 +1382,7 @@ bool clock_supported(clockid_t clock) {
                 if (!clock_boottime_supported())
                         return false;
 
-                /* fall through */
-
+                _fallthrough_;
         default:
                 /* For everything else, check properly */
                 return clock_gettime(clock, &ts) >= 0;
index b01c9c13730818dc3f52c69d116f3a4c18e7b0cc..46defae1bc82c326f1ccf22c05e64fa7d1c040c8 100644 (file)
@@ -532,7 +532,7 @@ static int job_perform_on_unit(Job **j) {
 
                 case JOB_RESTART:
                         t = JOB_STOP;
-                        /* fall through */
+                        _fallthrough_;
                 case JOB_STOP:
                         r = unit_stop(u);
                         break;
index 73b13977ed468d851bc3bd28e58a8fbc1a18a3ba..420ca13a3ffdba6be25517041db366a2d3c79dc5 100644 (file)
@@ -1,4 +1,7 @@
 %{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
 #include <stddef.h>
 #include "conf-parser.h"
 #include "load-fragment.h"
index ee9594a00fce85e0be059c8a5960a8bcb2eacfd3..1fc24eac76a165e44c0641fd567a48cd4ec80e46 100644 (file)
@@ -2155,7 +2155,7 @@ int main(int argc, char *argv[]) {
                                 goto finish;
                         }
 
-                        /* fallthrough */
+                        _fallthrough_;
                 case MANAGER_REBOOT:
                 case MANAGER_POWEROFF:
                 case MANAGER_HALT:
index 67fe3d21202699adffbd4cbcfa846b8b0096473c..cd723e7f4794ae3ac3e51ec625f3e1b51730aee9 100644 (file)
@@ -2113,8 +2113,7 @@ static int manager_dispatch_signal_fd(sd_event_source *source, int fd, uint32_t
                                 break;
                         }
 
-                        /* Fall through */
-
+                        _fallthrough_;
                 case SIGINT:
                         if (MANAGER_IS_SYSTEM(m))
                                 manager_handle_ctrl_alt_del(m);
index 738a1f5134319b0dc5f622096a9d6a87520d3ed7..218f2d8d9ac33ceb5174b7c2efc62b660ac554d3 100644 (file)
@@ -796,8 +796,8 @@ static int apply_mount(
 
         case BIND_MOUNT:
                 rbind = false;
-                /* fallthrough */
 
+                _fallthrough_;
         case BIND_MOUNT_RECURSIVE:
                 /* Also chase the source mount */
 
index 445d1becc108bbdac24a2afb9903db1436a8b693..b4662cd9f6dafee74cbde0382bfc8be0794b6f57 100644 (file)
@@ -2895,8 +2895,7 @@ static void service_notify_cgroup_empty_event(Unit *u) {
                         break;
                 }
 
-                /* Fall through */
-
+                _fallthrough_;
         case SERVICE_START_POST:
                 if (s->pid_file_pathspec &&
                     main_pid_good(s) == 0 &&
@@ -3057,8 +3056,7 @@ static void service_sigchld_event(Unit *u, pid_t pid, int code, int status) {
                                         break;
                                 }
 
-                                /* Fall through */
-
+                                _fallthrough_;
                         case SERVICE_RUNNING:
                                 service_enter_running(s, f);
                                 break;
index 04494f4eee4b3c0f7f1574560d1ea42d8a41e896..d54661b69877032e5c748cff456546b7384dfd46 100644 (file)
@@ -396,8 +396,7 @@ int main(int argc, char *argv[]) {
                 }
 
                 cmd = RB_AUTOBOOT;
-                /* Fall through */
-
+                _fallthrough_;
         case RB_AUTOBOOT:
 
                 if (!in_container) {
index 6c0d799bd97d6cfe89395821a26dbdd3eba2cb56..a1cc560d5b9e05436b43f5226b90a47be0fcb3ee 100644 (file)
@@ -2766,7 +2766,7 @@ const char* socket_port_type_to_string(SocketPort *p) {
                         if (socket_address_family(&p->address) == AF_NETLINK)
                                 return "Netlink";
 
-                        /* fall through */
+                        _fallthrough_;
                 default:
                         return NULL;
                 }
index 27f4f74b49e8d765694b06c810937581faec3a38..1a42b3847e43c2058e66e3859a0c3b7cc1163207 100644 (file)
@@ -417,7 +417,7 @@ static void timer_enter_waiting(Timer *t, bool initial) {
                                 /* In a container we don't want to include the time the host
                                  * was already up when the container started, so count from
                                  * our own startup. */
-                                /* fall through */
+                                _fallthrough_;
                         case TIMER_STARTUP:
                                 base = UNIT(t)->manager->userspace_timestamp.monotonic;
                                 break;
index a9751c25c53e40657d76f3364c69113fb12d56c1..6c214d27fc45c8c275d43e9488c5d1f181b0d462 100644 (file)
@@ -63,8 +63,8 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
                         }
 
                         pos += r;
-                }       /* fall through */
-
+                }
+                        _fallthrough_;
                 case ENTRY_REALTIME: {
                         usec_t realtime;
 
@@ -87,8 +87,8 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
                         }
 
                         pos += r;
-                }       /* fall through */
-
+                }
+                        _fallthrough_;
                 case ENTRY_MONOTONIC: {
                         usec_t monotonic;
                         sd_id128_t boot_id;
@@ -112,8 +112,8 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
                         }
 
                         pos += r;
-                }       /* fall through */
-
+                }
+                        _fallthrough_;
                 case ENTRY_BOOT_ID: {
                         sd_id128_t boot_id;
                         char sid[33];
@@ -137,8 +137,8 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
                         }
 
                         pos += r;
-                }       /* fall through */
-
+                }
+                        _fallthrough_;
                 case ENTRY_NEW_FIELD: {
                         u->field_pos = 0;
 
@@ -159,8 +159,8 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
                         }
 
                         u->entry_state++;
-                }       /* fall through */
-
+                }
+                        _fallthrough_;
                 case ENTRY_TEXT_FIELD:
                 case ENTRY_BINARY_FIELD: {
                         bool done;
@@ -209,8 +209,8 @@ static ssize_t write_entry(char *buf, size_t size, Uploader *u) {
 
                         u->field_pos = len + 1;
                         u->entry_state++;
-                }       /* fall through */
-
+                }
+                        _fallthrough_;
                 case ENTRY_BINARY_FIELD_SIZE: {
                         uint64_t le64;
 
index 4da0f3cdab44e8264f4b850fbb7b3fab002264d0..faa7e9bab67fcda7556f794f07629887cde9497d 100644 (file)
@@ -133,8 +133,7 @@ static void journal_file_set_offline_internal(JournalFile *f) {
                 case OFFLINE_OFFLINING:
                         if (!__sync_bool_compare_and_swap(&f->offline_state, OFFLINE_OFFLINING, OFFLINE_DONE))
                                 continue;
-                        /* fall through */
-
+                        _fallthrough_;
                 case OFFLINE_DONE:
                         return;
 
@@ -290,8 +289,7 @@ static int journal_file_set_online(JournalFile *f) {
                         if (!__sync_bool_compare_and_swap(&f->offline_state, OFFLINE_AGAIN_FROM_OFFLINING, OFFLINE_CANCEL))
                                 continue;
                         /* Canceled restart from offlining, must wait for offlining to complete however. */
-
-                        /* fall through */
+                        _fallthrough_;
                 default: {
                         int r;
 
index 6b05bda0aecfc42ec0a48bafe9ff30797b540123..e8c1f2e2d51d72768d14fd0bc4cac51fdf42779f 100644 (file)
@@ -1,4 +1,7 @@
 %{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
 #include <stddef.h>
 #include <sys/socket.h>
 #include "conf-parser.h"
index 93ca61fc8a4658141561f57dcf17555455c2e4f4..fae2cd59bec91f39bc65d08e5bf50ec61274fee9 100644 (file)
@@ -287,8 +287,7 @@ static void syslog_skip_date(char **buf) {
                         if (*p == ' ')
                                 break;
 
-                        /* fall through */
-
+                        _fallthrough_;
                 case NUMBER:
                         if (*p < '0' || *p > '9')
                                 return;
index 536bfef99e0e81e9f6578c834137c71b628ffcea..228af69d8880d18e4bd0862168122cf63aa168e8 100644 (file)
@@ -829,7 +829,6 @@ static int client_send_request(sd_dhcp_client *client) {
                    client’s IP address.
                 */
 
-                /* fall through */
         case DHCP_STATE_REBINDING:
                 /* â€™server identifier’ MUST NOT be filled in, â€™requested IP address’
                    option MUST NOT be filled in, â€™ciaddr’ MUST be filled in with
index 4fec89d2e39c403940313124b32dfb7dbf911a99..1c12e5430f44867143b778548e8bb3d864d4a5ed 100644 (file)
@@ -1035,7 +1035,7 @@ static int client_receive_message(
                         break;
                 }
 
-                /* fall through */ /* for Soliciation Rapid Commit option check */
+                _fallthrough_; /* for Soliciation Rapid Commit option check */
         case DHCP6_STATE_REQUEST:
         case DHCP6_STATE_RENEW:
         case DHCP6_STATE_REBIND:
@@ -1100,7 +1100,7 @@ static int client_start(sd_dhcp6_client *client, enum DHCP6State state) {
                         return 0;
                 }
 
-                /* fall through */
+                _fallthrough_;
         case DHCP6_STATE_SOLICITATION:
                 client->state = DHCP6_STATE_SOLICITATION;
 
index 1b2530ea33d129e4e0df6bebae9d8f931867a208..7cf4f031de531dffbde79f48af61619275d6337d 100644 (file)
@@ -288,8 +288,7 @@ static int ipv4acd_on_timeout(sd_event_source *s, uint64_t usec, void *userdata)
                         break;
                 }
 
-                /* fall through */
-
+                _fallthrough_;
         case IPV4ACD_STATE_WAITING_ANNOUNCE:
                 /* Send announcement packet */
                 r = arp_send_announcement(acd->fd, acd->ifindex, acd->address, &acd->mac_addr);
index 8a33d462b4612c92c6d231f4cc28f55a00b3e8e6..237392928522b07258560b4d13128e8809516137 100644 (file)
@@ -1452,7 +1452,7 @@ int message_append_basic(sd_bus_message *m, char type, const void *p, const void
                 case SD_BUS_TYPE_STRING:
                         p = strempty(p);
 
-                        /* Fall through... */
+                        _fallthrough_;
                 case SD_BUS_TYPE_OBJECT_PATH:
                         if (!p)
                                 return -EINVAL;
@@ -1512,7 +1512,7 @@ int message_append_basic(sd_bus_message *m, char type, const void *p, const void
                          * into the empty string */
                         p = strempty(p);
 
-                        /* Fall through... */
+                        _fallthrough_;
                 case SD_BUS_TYPE_OBJECT_PATH:
 
                         if (!p)
index 1957654d284e47e730e148c5b84ba6a18c963ab6..9fb455a94e229bfd92c4b1c785ab1a7ebb1204a4 100644 (file)
@@ -1756,8 +1756,7 @@ static int add_object_vtable_internal(
                                 goto fail;
                         }
 
-                        /* Fall through */
-
+                        _fallthrough_;
                 case _SD_BUS_VTABLE_PROPERTY: {
                         struct vtable_member *m;
 
index 273cbaeb423925610815346670d3e4077e7e95bf..b278eefa205d34821bb3544b32b96a6b5db7d52b 100644 (file)
@@ -564,7 +564,7 @@ int device_read_uevent_file(sd_device *device) {
                         value = &uevent[i];
                         state = VALUE;
 
-                        /* fall through */ /* to handle empty property */
+                        _fallthrough_; /* to handle empty property */
                 case VALUE:
                         if (strchr(NEWLINE, uevent[i])) {
                                 uevent[i] = '\0';
index 260a11dfc1d9828063f74c88716d4670ac78935e..5541e8d47e64707efd32bda46c4d69ba836a79d9 100644 (file)
@@ -117,7 +117,7 @@ int id128_read_fd(int fd, Id128Format f, sd_id128_t *ret) {
                 if (buffer[32] != '\n')
                         return -EINVAL;
 
-                /* fall through */
+                _fallthrough_;
         case 32: /* plain UUID without trailing newline */
                 if (f == ID128_UUID)
                         return -EINVAL;
@@ -129,7 +129,7 @@ int id128_read_fd(int fd, Id128Format f, sd_id128_t *ret) {
                 if (buffer[36] != '\n')
                         return -EINVAL;
 
-                /* fall through */
+                _fallthrough_;
         case 36: /* RFC UUID without trailing newline */
                 if (f == ID128_PLAIN)
                         return -EINVAL;
index aca464427b77acdd89061f0c3caf57303acf9106..ee62db63a559b4cd0b9739748436def0767ab22b 100644 (file)
@@ -1,4 +1,7 @@
 %{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
 #include <stddef.h>
 #include "conf-parser.h"
 #include "logind.h"
index 002efd7e9cf02e59e7c008b1a51a2cd261340340..89f600ef623045946d45999d762139350a403e6b 100644 (file)
@@ -1,4 +1,7 @@
 %{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
 #include <stddef.h>
 #include "conf-parser.h"
 #include "network-internal.h"
index 302c75d1706c758674754b145445863fee6e3580..976be17c0e4ed0f099373dcb87f7077350330067 100644 (file)
@@ -152,7 +152,7 @@ static void address_hash_func(const void *b, struct siphash *state) {
                         siphash24_compress(&prefix, sizeof(prefix), state);
                 }
 
-                /* fallthrough */
+                _fallthrough_;
         case AF_INET6:
                 /* local address */
                 siphash24_compress(&a->in_addr, FAMILY_ADDRESS_SIZE(a->family), state);
@@ -202,7 +202,7 @@ static int address_compare_func(const void *c1, const void *c2) {
                                 return 1;
                 }
 
-                /* fall-through */
+                _fallthrough_;
         case AF_INET6:
                 return memcmp(&a1->in_addr, &a2->in_addr, FAMILY_ADDRESS_SIZE(a1->family));
         default:
index 81086d26fd1de2eb56d1d7d4b9a7770d2597d74a..a46a11bf167d4217c1237c87108586c8adc45d33 100644 (file)
@@ -149,7 +149,7 @@ static void dhcp6_handler(sd_dhcp6_client *client, int event, void *userdata) {
                         return;
                 }
 
-                /* fall through */
+                _fallthrough_;
         case SD_DHCP6_CLIENT_EVENT_INFORMATION_REQUEST:
                 r = dhcp6_lease_information_acquired(client, link);
                 if (r < 0) {
index eca436d9fde4e61a0886a4a36b7eca82d7366136..54161446bba942bd58fe25dd4a4b9cf9a9de26e5 100644 (file)
@@ -1,4 +1,7 @@
 %{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
 #include <stddef.h>
 #include "conf-parser.h"
 #include "networkd-conf.h"
index ca0d67e3d2ce706cc38cadfd6f91e222da8d4ba0..5643e104cef6a82f6c356ea5f7cd73fe98dc21e6 100644 (file)
@@ -1,4 +1,7 @@
 %{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
 #include <stddef.h>
 #include "conf-parser.h"
 #include "networkd-conf.h"
index b61b347ee7c514fec1d92e1eaf6a325864935549..ea66971fac710b42cdfaeece952a219641ccef74 100644 (file)
@@ -1,4 +1,7 @@
 %{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
 #include <stddef.h>
 #include "conf-parser.h"
 #include "nspawn-settings.h"
index 85ba86b62ceeb4abb1cb9afb2adb27db6b7ea811..3bf4d6ed1bdadbb5cdcdf0d2036bfb114e154731 100644 (file)
@@ -569,8 +569,7 @@ static int parse_argv(int argc, char *argv[]) {
                         if (r < 0)
                                 return log_oom();
 
-                        /* fall through */
-
+                        _fallthrough_;
                 case 'n':
                         arg_network_veth = true;
                         arg_private_network = true;
@@ -624,8 +623,7 @@ static int parse_argv(int argc, char *argv[]) {
                         if (strv_extend(&arg_network_ipvlan, optarg) < 0)
                                 return log_oom();
 
-                        /* fall through */
-
+                        _fallthrough_;
                 case ARG_PRIVATE_NETWORK:
                         arg_private_network = true;
                         arg_settings_mask |= SETTING_NETWORK;
@@ -2013,8 +2011,7 @@ static int wait_for_container(pid_t pid, ContainerStatus *container) {
                         return 0;
                 }
 
-                /* fall through */
-
+                _fallthrough_;
         case CLD_DUMPED:
                 log_error("Container %s terminated by signal %s.", arg_machine, signal_to_string(status.si_status));
                 return -EIO;
index 8a0b43c277ae148db7607a2e9824270a1b667bf4..d4f7b94738734a2c86bcc30e83da7a77fe7a82bf 100755 (executable)
@@ -7,6 +7,12 @@ import sys
 
 name, prefix, input = sys.argv[1:]
 
+print("""\
+%{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \\"-Wimplicit-fallthrough\\"")
+#endif
+%}""")
 print("""\
 struct {}_name {{ const char* name; int id; }};
 %null-strings
index 5153563b9993bff3ebf09732d776456370f46f7f..a5865ce6c296bb93a14c60beaeec7e7e80a11c7a 100644 (file)
@@ -1,4 +1,7 @@
 %{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
 #include <stddef.h>
 #include "conf-parser.h"
 #include "resolved-conf.h"
index a9e5d608a52268dd703e0801cb0cd49e011ec743..2625a20ea5486fe7c370fa7fbbb63819fa073219 100644 (file)
@@ -513,8 +513,7 @@ int image_remove(Image *i) {
                 if (path_startswith(i->path, "/dev"))
                         break;
 
-                /* fallthrough */
-
+                _fallthrough_;
         case IMAGE_RAW:
                 if (unlink(i->path) < 0)
                         return -errno;
@@ -599,8 +598,7 @@ int image_rename(Image *i, const char *new_name) {
                 if (file_attr & FS_IMMUTABLE_FL)
                         (void) chattr_path(i->path, 0, FS_IMMUTABLE_FL);
 
-                /* fall through */
-
+                _fallthrough_;
         case IMAGE_SUBVOLUME:
                 new_path = file_in_same_dir(i->path, new_name);
                 break;
index e8ef5851e12a2262a4594ab87c1a6f155d695de4..7d4cd2808ea8d663c66e2e1a002802d6bda318b0 100644 (file)
@@ -1,4 +1,7 @@
 %{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
 #include <stddef.h>
 #include "conf-parser.h"
 #include "timesyncd-conf.h"
index 173774ea0a096fcc81424a1fbc228a31cc31cab1..a43d1552984908f3927a17543199529a4c19f594 100644 (file)
@@ -1305,8 +1305,7 @@ static int create_item(Item *i) {
                                 log_debug("Quota for subvolume \"%s\" already in place, no change made.", i->path);
                 }
 
-                /* fall through */
-
+                _fallthrough_;
         case EMPTY_DIRECTORY:
                 r = path_set_perms(i, i->path);
                 if (q < 0)
index 5724e4e3dc5e25b684678d47fada9dc061f53736..eb977447e3c3b7c8026f18e9ca473bfc826622bb 100755 (executable)
@@ -1,5 +1,10 @@
 #!/bin/sh -eu
 awk '   BEGIN {
+                print "%{\n\
+#if __GNUC__ >= 7\n\
+_Pragma(\"GCC diagnostic ignored \\\"-Wimplicit-fallthrough\\\"\")\n\
+#endif\n\
+%}"
                 print "struct key_name { const char* name; unsigned short id; };"
                 print "%null-strings"
                 print "%%"
index 52bb4775dd1d4ae6ecfe3dfb08b83b3c678e848e..85f0a0625b296621114b44f45c211846b2775b73 100644 (file)
@@ -1,4 +1,7 @@
 %{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
 #include <stddef.h>
 #include "conf-parser.h"
 #include "network-internal.h"
index 876525c3fff71a2c927f9974ade11b053a80e0bf..89891f9e274981354204b47a0cef06994670d515 100644 (file)
@@ -328,7 +328,7 @@ static bool should_rename(struct udev_device *device, bool respect_predictable)
                 /* the kernel claims to have given a predictable name */
                 if (respect_predictable)
                         return false;
-                /* fall through */
+                _fallthrough_;
         case NET_NAME_ENUM:
         default:
                 /* the name is known to be bad, or of an unknown type */
index 11c2b953e4824333374c719754201f2957b22b2d..bf6b28e8e534b5cfb06551666dd9369d6a594b51 100644 (file)
@@ -372,7 +372,7 @@ resend:
         switch (retval) {
                 case SG_ERR_CAT_NOTSUPPORTED:
                         buf[1] = 0;
-                        /* Fallthrough */
+                        _fallthrough_;
                 case SG_ERR_CAT_CLEAN:
                 case SG_ERR_CAT_RECOVERED:
                         retval = 0;
index 15a309fe7941f35edf28bbb5595ecf3e09c1a615..e9588abd695fe3f28ecb07da7c0b8d75b2d0b7d4 100644 (file)
@@ -1691,7 +1691,7 @@ static int match_attr(struct udev_rules *rules, struct udev_device *dev, struct
         case SB_FORMAT:
                 udev_event_apply_format(event, name, nbuf, sizeof(nbuf), false);
                 name = nbuf;
-                /* fall through */
+                _fallthrough_;
         case SB_NONE:
                 value = udev_device_get_sysattr_value(dev, name);
                 if (value == NULL)