[Git][ghc/ghc][wip/tsan/prep] rts: Introduce NO_WARN macro

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Mon Jul 24 17:59:11 UTC 2023



Ben Gamari pushed to branch wip/tsan/prep at Glasgow Haskell Compiler / GHC


Commits:
df059575 by Ben Gamari at 2023-07-24T13:58:58-04:00
rts: Introduce NO_WARN macro

This allows fine-grained ignoring of warnings.

- - - - -


1 changed file:

- rts/include/Stg.h


Changes:

=====================================
rts/include/Stg.h
=====================================
@@ -284,6 +284,17 @@
 # define STG_RETURNS_NONNULL
 #endif
 
+/* -----------------------------------------------------------------------------
+   Suppressing C warnings
+   -------------------------------------------------------------------------- */
+
+#define DO_PRAGMA(x) _Pragma(#x)
+#define NO_WARN(warnoption, ...)                   \
+    DO_PRAGMA(GCC diagnostic push)                 \
+    DO_PRAGMA(GCC diagnostic ignored #warnoption)  \
+    __VA_ARGS__                                    \
+    DO_PRAGMA(GCC diagnostic pop)
+
 /* -----------------------------------------------------------------------------
    Global type definitions
    -------------------------------------------------------------------------- */



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/df05957519aca01a83cbf4d55d3d199285e6957c

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/df05957519aca01a83cbf4d55d3d199285e6957c
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230724/57a14121/attachment-0001.html>


More information about the ghc-commits mailing list