diff options
author | Michal Marek <mmarek@suse.cz> | 2011-04-29 08:45:31 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2011-05-02 11:37:10 -0400 |
commit | a6de553da01c2c110c647fbd1c5bad29f5a82487 (patch) | |
tree | 7c24cf487f05cd7c20fe2f825c37999f11b30efc /scripts | |
parent | af0e5d565d2fffcd97d1e2d89669d627cc04e8b8 (diff) |
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=<level> does not include warnings
from the previous level.
Signed-off-by: Michal Marek <mmarek@suse.cz>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-By: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.build | 8 |
1 files changed, 6 insertions, 2 deletions
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 | |||
60 | # $(call cc-option, -W...) handles gcc -W.. options which | 60 | # $(call cc-option, -W...) handles gcc -W.. options which |
61 | # are not supported by all versions of the compiler | 61 | # are not supported by all versions of the compiler |
62 | ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS | 62 | ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS |
63 | warning- := $(empty) | ||
64 | |||
63 | warning-1 := -Wextra -Wunused -Wno-unused-parameter | 65 | warning-1 := -Wextra -Wunused -Wno-unused-parameter |
64 | warning-1 += -Wmissing-declarations | 66 | warning-1 += -Wmissing-declarations |
65 | warning-1 += -Wmissing-format-attribute | 67 | warning-1 += -Wmissing-format-attribute |
@@ -86,9 +88,11 @@ warning-3 += -Wswitch-default | |||
86 | warning-3 += $(call cc-option, -Wpacked-bitfield-compat) | 88 | warning-3 += $(call cc-option, -Wpacked-bitfield-compat) |
87 | warning-3 += $(call cc-option, -Wvla) | 89 | warning-3 += $(call cc-option, -Wvla) |
88 | 90 | ||
89 | warning := $(warning-$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)) | 91 | warning := $(warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) |
92 | warning += $(warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) | ||
93 | warning += $(warning-$(findstring 3, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) | ||
90 | 94 | ||
91 | ifeq ("$(warning)","") | 95 | ifeq ("$(strip $(warning))","") |
92 | $(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown) | 96 | $(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown) |
93 | endif | 97 | endif |
94 | 98 | ||