summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-06-24 20:51:13 +0100
committerIan Lynagh <igloo@earth.li>2011-06-25 19:16:32 +0100
commit0a6f26f6d29c8762b254e2f1040fce5c3571feea (patch)
tree6706444dab64cb0c2d6143ecb17db0e9ca2fc0cd /mk
parent12b93887fd8b6a185b1bff994c865c897d22a6a6 (diff)
downloadhaskell-0a6f26f6d29c8762b254e2f1040fce5c3571feea.tar.gz
Fix gcc 4.6 warnings; fixes #5176
Based on a patch from David Terei. Some parts are a little ugly (e.g. defining things that only ASSERTs use only when DEBUG is defined), so we might want to tweak things a little. I've also turned off -Werror for didn't-inline warnings, as we now get a few such warnings.
Diffstat (limited to 'mk')
-rw-r--r--mk/config.mk.in1
-rw-r--r--mk/validate-settings.mk9
2 files changed, 10 insertions, 0 deletions
diff --git a/mk/config.mk.in b/mk/config.mk.in
index 87f80f71c4..e39c5c7381 100644
--- a/mk/config.mk.in
+++ b/mk/config.mk.in
@@ -535,6 +535,7 @@ endif
WhatGccIsCalled = @WhatGccIsCalled@
GccVersion = @GccVersion@
GccLT34 = @GccLT34@
+GccLT46 = @GccLT46@
CC = $(WhatGccIsCalled)
CC_STAGE0 = @CC_STAGE0@
CC_STAGE1 = $(CC)
diff --git a/mk/validate-settings.mk b/mk/validate-settings.mk
index 184dfe2ff7..7dc124fcba 100644
--- a/mk/validate-settings.mk
+++ b/mk/validate-settings.mk
@@ -4,7 +4,16 @@
WERROR = -Werror
HADDOCK_DOCS = YES
+
SRC_CC_OPTS += -Wall $(WERROR)
+# Debian doesn't turn -Werror=unused-but-set-variable on by default, so
+# we turn it on explicitly for consistency with other users
+ifeq "$(GccLT46)" "NO"
+SRC_CC_OPTS += -Werror=unused-but-set-variable
+endif
+# gcc 4.6 gives 3 warning for giveCapabilityToTask not being inlined
+SRC_CC_OPTS += -Wno-error=inline
+
SRC_HC_OPTS += -Wall $(WERROR) -H64m -O0
# Safe by default