From a6de553da01c2c110c647fbd1c5bad29f5a82487 Mon Sep 17 00:00:00 2001 From: Michal Marek Date: Fri, 29 Apr 2011 14:45:31 +0200 Subject: kbuild: Allow to combine multiple W= levels Add support for make W=12, make W=123 and so on, to enable warnings from multiple W= levels. Normally, make W= does not include warnings from the previous level. Signed-off-by: Michal Marek Acked-by: Sam Ravnborg Reviewed-By: Valdis Kletnieks --- scripts/Makefile.build | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts/Makefile.build') diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 9fb19c0fbf8c..f133641f815a 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -60,6 +60,8 @@ endif # $(call cc-option, -W...) handles gcc -W.. options which # are not supported by all versions of the compiler ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS +warning- := $(empty) + warning-1 := -Wextra -Wunused -Wno-unused-parameter warning-1 += -Wmissing-declarations warning-1 += -Wmissing-format-attribute @@ -86,9 +88,11 @@ warning-3 += -Wswitch-default warning-3 += $(call cc-option, -Wpacked-bitfield-compat) warning-3 += $(call cc-option, -Wvla) -warning := $(warning-$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)) +warning := $(warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) +warning += $(warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) +warning += $(warning-$(findstring 3, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) -ifeq ("$(warning)","") +ifeq ("$(strip $(warning))","") $(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown) endif -- cgit v1.2.3