From 1f57b4834650e693ac554a09bfd20b51196324ac Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Thu, 29 Feb 2024 09:47:19 +0800 Subject: [PATCH] Compiler detection - __attribute__((fallthrough)) for clang Clang supports `__attribute__((fallthrough))`. While C++ sources use [[attribute]], the C codepath still requires a fallback. Change-Id: Iaa93d2debc21fdd34e414ddb024b95942ae9191f Reviewed-by: Thiago Macieira (cherry picked from commit 376ff95e9308b311038bb316ef36d04244d55b66) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/global/qcompilerdetection.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index bad9583a849..673f1c795bb 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -1222,11 +1222,11 @@ #endif #endif #ifndef Q_FALLTHROUGH -# if defined(Q_CC_GNU_ONLY) && Q_CC_GNU >= 700 +# ifdef Q_CC_GNU # define Q_FALLTHROUGH() __attribute__((fallthrough)) # else # define Q_FALLTHROUGH() (void)0 -#endif +# endif #endif