[commit: ghc] circleci-centos: rts: Disable fallthrough attribute when compiling with Clang (515633e)

git at git.haskell.org git at git.haskell.org
Tue Dec 11 03:02:57 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : circleci-centos
Link       : http://ghc.haskell.org/trac/ghc/changeset/515633ebaef7fa1cc20322f01479f81e3fd96952/ghc

>---------------------------------------------------------------

commit 515633ebaef7fa1cc20322f01479f81e3fd96952
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Mon Dec 10 21:48:51 2018 -0500

    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).


>---------------------------------------------------------------

515633ebaef7fa1cc20322f01479f81e3fd96952
 includes/Stg.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/includes/Stg.h b/includes/Stg.h
index 9b54526..57cb00d 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)



More information about the ghc-commits mailing list