[commit: ghc] master: ghc-prim: Silence -Wsync-nand warning in atomic.c (94f0254)

git at git.haskell.org git at git.haskell.org
Thu Mar 8 22:05:55 UTC 2018


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/94f02547083cf6df686ea0b95fed050184c533de/ghc

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

commit 94f02547083cf6df686ea0b95fed050184c533de
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Thu Mar 8 13:22:37 2018 -0500

    ghc-prim: Silence -Wsync-nand warning in atomic.c
    
    GCC throws this warning to inform us that __sync_fetch_and_nand's
    behavior changed in GCC 4.4. However, this causes the build to fail when
    -Werror is used.
    
    Test Plan: Validate with -Werror
    
    Subscribers: rwbarton, thomie, carter
    
    Differential Revision: https://phabricator.haskell.org/D4481


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

94f02547083cf6df686ea0b95fed050184c533de
 libraries/ghc-prim/cbits/atomic.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libraries/ghc-prim/cbits/atomic.c b/libraries/ghc-prim/cbits/atomic.c
index 722d261..80d4f39 100644
--- a/libraries/ghc-prim/cbits/atomic.c
+++ b/libraries/ghc-prim/cbits/atomic.c
@@ -122,6 +122,10 @@ hs_atomic_and64(StgWord x, StgWord64 val)
 #define __has_builtin(x) 0
 #endif
 
+// Otherwise this fails with -Werror
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wsync-nand"
+
 extern StgWord hs_atomic_nand8(StgWord x, StgWord val);
 StgWord
 hs_atomic_nand8(StgWord x, StgWord val)
@@ -168,6 +172,8 @@ hs_atomic_nand64(StgWord x, StgWord64 val)
 }
 #endif
 
+#pragma GCC diagnostic pop
+
 // FetchOrByteArrayOp_Int
 
 extern StgWord hs_atomic_or8(StgWord x, StgWord val);



More information about the ghc-commits mailing list