mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 06:32:08 +00:00
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>
This commit is contained in:
parent
af0e5d565d
commit
a6de553da0
2 changed files with 7 additions and 3 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue