From 9af34b1c0aeaa0d8fa2fec6b317fa9df8a3b0e6d Mon Sep 17 00:00:00 2001 From: Shawn Landden Date: Fri, 24 Nov 2017 01:08:12 -0800 Subject: __attribute__((fallthrough)) only when -Wimplicit-fallthrough (#7448) 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/elogind/elogind/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 | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/basic/macro.h b/src/basic/macro.h index 34e0657ac..c5671d7db 100644 --- a/src/basic/macro.h +++ b/src/basic/macro.h @@ -47,7 +47,11 @@ #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 \ -- cgit v1.2.3