KCONFIG_WARN_UNKNOWN_SYMBOLS=1 and KCONFIG_WERROR=1 are descriptive and suitable in scripting, but typing them from the command line can be tedious. Associate them with KBUILD_EXTRA_WARN (and the W= shorthand). Support a new letter 'c' to enable extra checks in Kconfig. You can still manage compiler warnings (W=1) and Kconfig warnings (W=c) independently. Reuse the letter 'e' to turn Kconfig warnings into errors. As usual, you can combine multiple letters in KCONFIG_EXTRA_WARN. $ KCONFIG_WARN_UNKNOWN_SYMBOLS=1 KCONFIG_WERROR=1 make defconfig can be shortened to: $ KBUILD_EXTRA_WARN=ce make defconfig or, even shorter: $ make W=ce defconfig
Showing the changes to scripts (2 of 3 files). Show all
Unified · Split
| @@ -80,15 +80,6 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init) · 79 unmodified lines | |||
| 80 | # Warn if there is an enum types mismatch | 80 | # Warn if there is an enum types mismatch |
| 81 | KBUILD_CFLAGS += $(call cc-option,-Wenum-conversion) | 81 | KBUILD_CFLAGS += $(call cc-option,-Wenum-conversion) |
| 82 | 82 | ||
| 83 | # backward compatibility | ||
| 84 | KBUILD_EXTRA_WARN ?= $(KBUILD_ENABLE_EXTRA_GCC_CHECKS) | ||
| 85 | |||
| 86 | ifeq ("$(origin W)", "command line") | ||
| 87 | KBUILD_EXTRA_WARN := $(W) | ||
| 88 | endif | ||
| 89 | |||
| 90 | export KBUILD_EXTRA_WARN | ||
| 91 | |||
| 92 | # | 83 | # |
| 93 | # W=1 - warnings which may be relevant and do not occur too often | 84 | # W=1 - warnings which may be relevant and do not occur too often |
| 94 | # | 85 | # |
| @@ -27,6 +27,14 @@ KCONFIG_DEFCONFIG_LIST += \ · 26 unmodified lines | |||
| 27 | endif | 27 | endif |
| 28 | KCONFIG_DEFCONFIG_LIST += arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) | 28 | KCONFIG_DEFCONFIG_LIST += arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) |
| 29 | 29 | ||
| 30 | ifneq ($(findstring c, $(KBUILD_EXTRA_WARN)),) | ||
| 31 | export KCONFIG_WARN_UNKNOWN_SYMBOLS=1 | ||
| 32 | endif | ||
| 33 | |||
| 34 | ifneq ($(findstring e, $(KBUILD_EXTRA_WARN)),) | ||
| 35 | export KCONFIG_WERROR=1 | ||
| 36 | endif | ||
| 37 | |||
| 30 | # We need this, in case the user has it in its environment | 38 | # We need this, in case the user has it in its environment |
| 31 | unexport CONFIG_ | 39 | unexport CONFIG_ |
| 32 | 40 | ||