summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2010-08-05 15:50:23 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2010-08-05 15:50:23 +0200
commit0d289184bf512efb27d805f993e6e2c76f0fe8b3 (patch)
treeb3fef5a936646ecd7eebcda1d7ab39d7b38bd12a
parenta5dee57033f7d9987858d2c0514f4e687ece2874 (diff)
buildsys: check_gcc warning flags
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-rw-r--r--Rules.mak23
1 files changed, 18 insertions, 5 deletions
diff --git a/Rules.mak b/Rules.mak
index 03eea2cc1..1f05a8a53 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -531,12 +531,25 @@ export ASNEEDED:=$(shell $(LD) --help 2>/dev/null | grep -q -- --as-needed && ec
endif
# Add a bunch of extra pedantic annoyingly strict checks
-XWARNINGS=$(call qstrip,$(WARNINGS)) -Wstrict-prototypes -fno-strict-aliasing
+XWARNINGS=$(call qstrip,$(WARNINGS))
+XWARNINGS+=$(foreach w,\
+ -Wstrict-prototypes \
+ -fno-strict-aliasing \
+ , $(call check_gcc,$(w),))
ifeq ($(EXTRA_WARNINGS),y)
-XWARNINGS+=-Wnested-externs -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wformat=2
-XWARNINGS+=-Wmissing-prototypes -Wmissing-declarations
-XWARNINGS+=-Wold-style-declaration -Wold-style-definition
-XWARNINGS+=-Wnonnull -Wundef
+XWARNINGS+=$(foreach w,\
+ -Wformat=2 \
+ -Wmissing-noreturn \
+ -Wmissing-format-attribute \
+ -Wmissing-prototypes \
+ -Wmissing-declarations \
+ -Wnested-externs \
+ -Wnonnull \
+ -Wold-style-declaration \
+ -Wold-style-definition \
+ -Wshadow \
+ -Wundef \
+ , $(call check_gcc,$(w),))
# Works only w/ gcc-3.4 and up, can't be checked for gcc-3.x w/ check_gcc()
#XWARNINGS+=-Wdeclaration-after-statement
endif