summaryrefslogtreecommitdiff
path: root/includes/Stg.h
diff options
context:
space:
mode:
authorErik de Castro Lopo <erik.decastrolopo@ambiata.com>2017-04-05 05:53:46 +1000
committerBen Gamari <ben@smart-cactus.org>2017-04-28 22:35:04 -0400
commite5b3492f23c2296d0d8221e1787ee585331f726e (patch)
treee1d6797dadc265db7f97615ff71c65c3d83db9c0 /includes/Stg.h
parent6d14c1485cb570cbd183bcdc0f858d9a6dc1eb31 (diff)
downloadhaskell-e5b3492f23c2296d0d8221e1787ee585331f726e.tar.gz
Enable new warning for fragile/incorrect CPP #if usage
The C code in the RTS now gets built with `-Wundef` and the Haskell code (stages 1 and 2 only) with `-Wcpp-undef`. We now get warnings whereever `#if` is used on undefined identifiers. Test Plan: Validate on Linux and Windows Reviewers: austin, angerman, simonmar, bgamari, Phyx Reviewed By: bgamari Subscribers: thomie, snowleopard Differential Revision: https://phabricator.haskell.org/D3278
Diffstat (limited to 'includes/Stg.h')
-rw-r--r--includes/Stg.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/Stg.h b/includes/Stg.h
index 063959d880..a0886ef727 100644
--- a/includes/Stg.h
+++ b/includes/Stg.h
@@ -146,7 +146,7 @@
// to force gnu90-style 'external inline' semantics.
#if defined(FORCE_GNU_INLINE)
// disable auto-detection since HAVE_GNU_INLINE has been defined externally
-#elif __GNUC_GNU_INLINE__ && __GNUC__ == 4 && __GNUC_MINOR__ == 2
+#elif defined(__GNUC_GNU_INLINE__) && __GNUC__ == 4 && __GNUC_MINOR__ == 2
// GCC 4.2.x didn't properly support C99 inline semantics (GCC 4.3 was the first
// release to properly support C99 inline semantics), and therefore warned when
// using 'extern inline' while in C99 mode unless `__attributes__((gnu_inline))`
@@ -154,14 +154,14 @@
# define FORCE_GNU_INLINE 1
#endif
-#if FORCE_GNU_INLINE
+#ifdef FORCE_GNU_INLINE
// Force compiler into gnu90 semantics
# if defined(KEEP_INLINES)
# define EXTERN_INLINE inline __attribute__((gnu_inline))
# else
# define EXTERN_INLINE extern inline __attribute__((gnu_inline))
# endif
-#elif __GNUC_GNU_INLINE__
+#elif defined(__GNUC_GNU_INLINE__)
// we're currently in gnu90 inline mode by default and
// __attribute__((gnu_inline)) may not be supported, so better leave it off
# if defined(KEEP_INLINES)