From: Shawn Landden Date: Fri, 24 Nov 2017 09:08:12 +0000 (-0800) Subject: __attribute__((fallthrough)) only when -Wimplicit-fallthrough (#7448) X-Git-Tag: v236~134 X-Git-Url: http://git-history.diyao.me/?a=commitdiff_plain;h=fb8e74a4999c8a3f216cb218032db9da0243bdcb;p=systemd%2F.git __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/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 --- diff --git a/src/basic/macro.h b/src/basic/macro.h index 2c6e46b6c8..78679083e8 100644 --- a/src/basic/macro.h +++ b/src/basic/macro.h @@ -48,7 +48,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 \