Enable -Wcpp-undef for GHC and runtime system
authorBen Gamari <bgamari.foss@gmail.com>
Fri, 18 Aug 2017 12:37:14 +0000 (08:37 -0400)
committerBen Gamari <ben@smart-cactus.org>
Sat, 19 Aug 2017 03:28:16 +0000 (23:28 -0400)
This gets us much of the benefit of enabling it globally, which avoiding
(at least for now) the pain of making the core libraries build as well.
See #13636.

Test Plan: Validate

Reviewers: erikd, austin

Subscribers: rwbarton, thomie

GHC Trac Issues: #13636

Differential Revision: https://phabricator.haskell.org/D3517

mk/warnings.mk

index 16d13a2..85cb1a0 100644 (file)
@@ -8,9 +8,14 @@ SRC_HC_OPTS     += -Wall
 # isn't supported yet (https://ghc.haskell.org/trac/ghc/wiki/Design/Warnings).
 #
 # See Note [Stage number in build variables] in mk/config.mk.in.
-SRC_HC_OPTS_STAGE1 += $(WERROR) #-Wcpp-undef
-SRC_HC_OPTS_STAGE2 += $(WERROR) #-Wcpp-undef
-
+SRC_HC_OPTS_STAGE1 += $(WERROR)
+SRC_HC_OPTS_STAGE2 += $(WERROR)
+
+# Enable -Wcpp-undef for GHC components only as we don't (currently) expect core
+# libraries to build in this configuration (see #13636).
+GhcRtsHcOpts    += -Wcpp-undef
+GhcStage1HcOpts += -Wcpp-undef
+GhcStage2HcOpts += -Wcpp-undef
 
 ifneq "$(GccIsClang)" "YES"