summaryrefslogtreecommitdiff
path: root/rts/ghc.mk
diff options
context:
space:
mode:
authorErik de Castro Lopo <erik.decastrolopo@ambiata.com>2017-04-05 05:53:46 +1000
committerErik de Castro Lopo <erikd@mega-nerd.com>2017-04-05 05:53:47 +1000
commit7e340c2bbf4a56959bd1e95cdd1cfdb2b7e537c2 (patch)
tree0f330ad348b5100f1a21312e7c91e43966789ec8 /rts/ghc.mk
parent5e968f9261b798222a845ef38a54621b45013678 (diff)
downloadhaskell-7e340c2bbf4a56959bd1e95cdd1cfdb2b7e537c2.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 'rts/ghc.mk')
-rw-r--r--rts/ghc.mk5
1 files changed, 4 insertions, 1 deletions
diff --git a/rts/ghc.mk b/rts/ghc.mk
index b756d942ca..e24e199598 100644
--- a/rts/ghc.mk
+++ b/rts/ghc.mk
@@ -267,7 +267,10 @@ WARNING_OPTS += -Waggregate-return
WARNING_OPTS += -Wpointer-arith
WARNING_OPTS += -Wmissing-noreturn
WARNING_OPTS += -Wnested-externs
-WARNING_OPTS += -Wredundant-decls
+WARNING_OPTS += -Wredundant-decls
+ifeq "$(GccLT46)" "NO"
+WARNING_OPTS += -Wundef
+endif
# These ones are hard to avoid:
#WARNING_OPTS += -Wconversion