diff options
author | Ben Gamari <ben@smart-cactus.org> | 2018-12-10 21:48:51 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-12-11 10:03:40 -0500 |
commit | 6a71add81d8f30b0caca0e869fb8e35787881c87 (patch) | |
tree | 7d315265acf499df84db949dd0ff218dff01b28a /includes/Stg.h | |
parent | e709c8f8d45c699840f5bab7c9ff71373a53b8b0 (diff) | |
download | haskell-6a71add81d8f30b0caca0e869fb8e35787881c87.tar.gz |
rts: Disable fallthrough attribute when compiling with Clang
Apparently clang doesn't enable implicitly fallthrough warnings by default
http://llvm.org/viewvc/llvm-project?revision=167655&view=revision when compiling
C and the attribute cause warnings of their own (#16019).
Diffstat (limited to 'includes/Stg.h')
-rw-r--r-- | includes/Stg.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/includes/Stg.h b/includes/Stg.h index 9b54526342..57cb00d0a4 100644 --- a/includes/Stg.h +++ b/includes/Stg.h @@ -197,7 +197,11 @@ #endif /* Used to mark a switch case that falls-through */ -#if (defined(__GNUC__) && __GNUC__ >= 7) || defined(__clang__) +#if (defined(__GNUC__) && __GNUC__ >= 7) +// N.B. Don't enable fallthrough annotations when compiling with Clang. +// Apparently clang doesn't enable implicitly fallthrough warnings by default +// http://llvm.org/viewvc/llvm-project?revision=167655&view=revision +// when compiling C and the attribute cause warnings of their own (#16019). #define FALLTHROUGH GNU_ATTRIBUTE(fallthrough) #else #define FALLTHROUGH ((void)0) |