diff options
author | Shawn Landden <slandden@gmail.com> | 2017-11-19 10:06:10 -0800 |
---|---|---|
committer | Shawn Landden <slandden@gmail.com> | 2017-11-20 13:06:25 -0800 |
commit | 4831981d89c628606c825779c75afb03b4839618 (patch) | |
tree | 7e35cbb6e0f1fedb3e543dc14d9ac2553e8ed39e /src/udev | |
parent | hwdb: Add ACCEL_MOUNT_MATRIX for the Acer Aspire Switch 10 convertible (diff) | |
download | systemd-4831981d89c628606c825779c75afb03b4839618.tar.gz systemd-4831981d89c628606c825779c75afb03b4839618.tar.bz2 systemd-4831981d89c628606c825779c75afb03b4839618.zip |
tree-wide: adjust fall through comments so that gcc is happy
Distcc removes comments, making the comment silencing
not work.
I know there was a decision against a macro in commit
ec251fe7d5bc24b5d38b0853bc5969f3a0ba06e2
Diffstat (limited to 'src/udev')
-rwxr-xr-x | src/udev/generate-keyboard-keys-gperf.sh | 5 | ||||
-rw-r--r-- | src/udev/net/link-config-gperf.gperf | 3 | ||||
-rw-r--r-- | src/udev/net/link-config.c | 2 | ||||
-rw-r--r-- | src/udev/scsi_id/scsi_serial.c | 2 | ||||
-rw-r--r-- | src/udev/udev-rules.c | 2 |
5 files changed, 11 insertions, 3 deletions
diff --git a/src/udev/generate-keyboard-keys-gperf.sh b/src/udev/generate-keyboard-keys-gperf.sh index 5724e4e3d..eb977447e 100755 --- a/src/udev/generate-keyboard-keys-gperf.sh +++ b/src/udev/generate-keyboard-keys-gperf.sh @@ -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 "%%" diff --git a/src/udev/net/link-config-gperf.gperf b/src/udev/net/link-config-gperf.gperf index 52bb4775d..85f0a0625 100644 --- a/src/udev/net/link-config-gperf.gperf +++ b/src/udev/net/link-config-gperf.gperf @@ -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" diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c index 876525c3f..89891f9e2 100644 --- a/src/udev/net/link-config.c +++ b/src/udev/net/link-config.c @@ -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 */ diff --git a/src/udev/scsi_id/scsi_serial.c b/src/udev/scsi_id/scsi_serial.c index 11c2b953e..bf6b28e8e 100644 --- a/src/udev/scsi_id/scsi_serial.c +++ b/src/udev/scsi_id/scsi_serial.c @@ -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; diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c index 15a309fe7..e9588abd6 100644 --- a/src/udev/udev-rules.c +++ b/src/udev/udev-rules.c @@ -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) |