From: Mike Yuan Date: Wed, 15 Jan 2025 18:16:06 +0000 (+0100) Subject: tree-wide: remove unnecessary gcc >= 7 version check X-Git-Tag: v258-rc1~1585^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=347eb8fbe3cfb5960995c86cd91065a37552ab6f;p=thirdparty%2Fsystemd.git tree-wide: remove unnecessary gcc >= 7 version check Our baseline is gcc 8.4. --- diff --git a/src/basic/MurmurHash2.c b/src/basic/MurmurHash2.c index 43a89a0820b..bb4cd6b9067 100644 --- a/src/basic/MurmurHash2.c +++ b/src/basic/MurmurHash2.c @@ -16,9 +16,7 @@ #include "MurmurHash2.h" -#if __GNUC__ >= 7 _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") -#endif //----------------------------------------------------------------------------- // Platform-specific functions and macros diff --git a/src/core/load-fragment-gperf.gperf.in b/src/core/load-fragment-gperf.gperf.in index 04a560110e6..a5656a42b38 100644 --- a/src/core/load-fragment-gperf.gperf.in +++ b/src/core/load-fragment-gperf.gperf.in @@ -268,9 +268,7 @@ {%- endmacro -%} %{ -#if __GNUC__ >= 7 _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") -#endif #include #include "all-units.h" #include "conf-parser.h" diff --git a/src/fundamental/macro-fundamental.h b/src/fundamental/macro-fundamental.h index 35758b5b189..709657dd285 100644 --- a/src/fundamental/macro-fundamental.h +++ b/src/fundamental/macro-fundamental.h @@ -84,10 +84,10 @@ # define _alloc_(...) __attribute__((__alloc_size__(__VA_ARGS__))) #endif -#if __GNUC__ >= 7 || (defined(__clang__) && __clang_major__ >= 10) -# define _fallthrough_ __attribute__((__fallthrough__)) -#else +#if defined(__clang__) && __clang_major__ < 10 # define _fallthrough_ +#else +# define _fallthrough_ __attribute__((__fallthrough__)) #endif #define XSTRINGIFY(x) #x diff --git a/src/home/homed-gperf.gperf b/src/home/homed-gperf.gperf index 39aca35b08e..9c1028642e9 100644 --- a/src/home/homed-gperf.gperf +++ b/src/home/homed-gperf.gperf @@ -1,8 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ %{ -#if __GNUC__ >= 7 _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") -#endif #include #include "conf-parser.h" #include "homed-conf.h" diff --git a/src/journal/journald-gperf.gperf b/src/journal/journald-gperf.gperf index 49987f5fae3..7163c402aa8 100644 --- a/src/journal/journald-gperf.gperf +++ b/src/journal/journald-gperf.gperf @@ -1,8 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ %{ -#if __GNUC__ >= 7 _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") -#endif #include #include #include "conf-parser.h" diff --git a/src/libsystemd/sd-journal/lookup3.c b/src/libsystemd/sd-journal/lookup3.c index c2a640687c0..8e3dac05afa 100644 --- a/src/libsystemd/sd-journal/lookup3.c +++ b/src/libsystemd/sd-journal/lookup3.c @@ -55,9 +55,7 @@ on 1 byte), but shoehorning those bytes into integers efficiently is messy. # include /* attempt to define endianness */ #endif -#if __GNUC__ >= 7 _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") -#endif /* * My best guess at if you are big-endian or little-endian. This may diff --git a/src/login/logind-gperf.gperf b/src/login/logind-gperf.gperf index e7f39fed2a9..da9fda6d4a5 100644 --- a/src/login/logind-gperf.gperf +++ b/src/login/logind-gperf.gperf @@ -1,8 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ %{ -#if __GNUC__ >= 7 _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") -#endif #include #include "conf-parser.h" #include "logind.h" diff --git a/src/network/netdev/netdev-gperf.gperf b/src/network/netdev/netdev-gperf.gperf index be010665c5d..5cef68caa1b 100644 --- a/src/network/netdev/netdev-gperf.gperf +++ b/src/network/netdev/netdev-gperf.gperf @@ -1,8 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ %{ -#if __GNUC__ >= 7 _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") -#endif #include #include "bareudp.h" #include "batadv.h" diff --git a/src/network/networkd-gperf.gperf b/src/network/networkd-gperf.gperf index 21e8d12690b..e2b84f13849 100644 --- a/src/network/networkd-gperf.gperf +++ b/src/network/networkd-gperf.gperf @@ -1,8 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ %{ -#if __GNUC__ >= 7 _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") -#endif #include #include "conf-parser.h" #include "networkd-address-label.h" diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf index dc462b690c2..891a96cc608 100644 --- a/src/network/networkd-network-gperf.gperf +++ b/src/network/networkd-network-gperf.gperf @@ -1,8 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ %{ -#if __GNUC__ >= 7 _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") -#endif #include #include diff --git a/src/nspawn/nspawn-gperf.gperf b/src/nspawn/nspawn-gperf.gperf index 123ef0c6c87..12b865299dd 100644 --- a/src/nspawn/nspawn-gperf.gperf +++ b/src/nspawn/nspawn-gperf.gperf @@ -1,8 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ %{ -#if __GNUC__ >= 7 _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") -#endif #include #include "conf-parser.h" #include "nspawn-settings.h" diff --git a/src/resolve/generate-dns_type-gperf.py b/src/resolve/generate-dns_type-gperf.py index 0d818fb3d97..b1837c7449f 100755 --- a/src/resolve/generate-dns_type-gperf.py +++ b/src/resolve/generate-dns_type-gperf.py @@ -10,9 +10,7 @@ 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; }}; diff --git a/src/resolve/resolved-gperf.gperf b/src/resolve/resolved-gperf.gperf index 68839352f55..543115ea9ea 100644 --- a/src/resolve/resolved-gperf.gperf +++ b/src/resolve/resolved-gperf.gperf @@ -1,8 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ %{ -#if __GNUC__ >= 7 _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") -#endif #include #include "conf-parser.h" #include "resolved-conf.h" diff --git a/src/timesync/timesyncd-gperf.gperf b/src/timesync/timesyncd-gperf.gperf index 731dea12e3a..37eb56eed55 100644 --- a/src/timesync/timesyncd-gperf.gperf +++ b/src/timesync/timesyncd-gperf.gperf @@ -1,8 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ %{ -#if __GNUC__ >= 7 _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") -#endif #include #include "conf-parser.h" #include "timesyncd-conf.h" diff --git a/src/udev/generate-keyboard-keys-gperf.sh b/src/udev/generate-keyboard-keys-gperf.sh index 9f4364c1725..6d2f3606b8b 100755 --- a/src/udev/generate-keyboard-keys-gperf.sh +++ b/src/udev/generate-keyboard-keys-gperf.sh @@ -6,9 +6,7 @@ set -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" diff --git a/src/udev/net/link-config-gperf.gperf b/src/udev/net/link-config-gperf.gperf index e4db56e8445..a313818e017 100644 --- a/src/udev/net/link-config-gperf.gperf +++ b/src/udev/net/link-config-gperf.gperf @@ -1,8 +1,6 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ %{ -#if __GNUC__ >= 7 _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"") -#endif #include #include "conf-parser.h" #include "ethtool-util.h" diff --git a/tools/generate-gperfs.py b/tools/generate-gperfs.py index 3887bb6ee9a..e2d6e30b7a8 100755 --- a/tools/generate-gperfs.py +++ b/tools/generate-gperfs.py @@ -16,9 +16,7 @@ if __name__ == '__main__': print("""\ %{ -#if __GNUC__ >= 7 _Pragma("GCC diagnostic ignored \\"-Wimplicit-fallthrough\\"") -#endif %}""") print(f"""\ struct {name}_name {{ const char* name; int id; }};