]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
__attribute__((fallthrough)) only when -Wimplicit-fallthrough (#7448)
authorShawn Landden <slandden@gmail.com>
Fri, 24 Nov 2017 09:08:12 +0000 (01:08 -0800)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 24 Nov 2017 09:08:12 +0000 (10:08 +0100)
That is version 7 or greater
https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/

Fix regression of https://github.com/systemd/systemd/pull/7389
82a27ba8217d09e4fef4c9550f8b733d174c5705
on older gccs

bumping to re-run CI
upstream             FAIL timed out
boot-smoke           FAIL non-zero exit status 1

src/basic/macro.h

index 2c6e46b6c83bfbbeb4e83cf4e2d1cf9a056c535d..78679083e85e4f673a92aacc5cd9a10f6b290bbc 100644 (file)
 #define _weakref_(x) __attribute__((weakref(#x)))
 #define _alignas_(x) __attribute__((aligned(__alignof(x))))
 #define _cleanup_(x) __attribute__((cleanup(x)))
+#if __GNUC__ >= 7
 #define _fallthrough_ __attribute__((fallthrough))
+#else
+#define _fallthrough_
+#endif
 
 /* Temporarily disable some warnings */
 #define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT                     \