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 <thiago.macieira@intel.com>
(cherry picked from commit 376ff95e9308b311038bb316ef36d04244d55b66)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tim Blechmann 2024-02-29 09:47:19 +08:00 committed by Qt Cherry-pick Bot
parent 9539f527fc
commit 1f57b48346

View File

@ -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