aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.build
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r--scripts/Makefile.build65
1 files changed, 38 insertions, 27 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index e1244ef308ce..9c0c48127946 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -51,36 +51,47 @@ ifeq ($(KBUILD_NOPEDANTIC),)
51endif 51endif
52 52
53# 53#
54# make W=1 settings 54# make W=... settings
55# 55#
56# $(call cc-option... ) handles gcc -W.. options which 56# W=1 - warnings that may be relevant and does not occur too often
57# W=2 - warnings that occur quite often but may still be relevant
58# W=3 - the more obscure warnings, can most likely be ignored
59#
60# $(call cc-option, -W...) handles gcc -W.. options which
57# are not supported by all versions of the compiler 61# are not supported by all versions of the compiler
58ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS 62ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS
59KBUILD_EXTRA_WARNINGS := -Wextra 63warning-1 := -Wextra -Wunused -Wno-unused-parameter
60KBUILD_EXTRA_WARNINGS += -Wunused -Wno-unused-parameter 64warning-1 += -Wmissing-declarations
61KBUILD_EXTRA_WARNINGS += -Waggregate-return 65warning-1 += -Wmissing-format-attribute
62KBUILD_EXTRA_WARNINGS += -Wbad-function-cast 66warning-1 += -Wmissing-prototypes
63KBUILD_EXTRA_WARNINGS += -Wcast-qual 67warning-1 += -Wold-style-definition
64KBUILD_EXTRA_WARNINGS += -Wcast-align 68warning-1 += $(call cc-option, -Wmissing-include-dirs)
65KBUILD_EXTRA_WARNINGS += -Wconversion 69
66KBUILD_EXTRA_WARNINGS += -Wdisabled-optimization 70warning-2 := -Waggregate-return
67KBUILD_EXTRA_WARNINGS += -Wlogical-op 71warning-2 += -Wcast-align
68KBUILD_EXTRA_WARNINGS += -Wmissing-declarations 72warning-2 += -Wdisabled-optimization
69KBUILD_EXTRA_WARNINGS += -Wmissing-format-attribute 73warning-2 += -Wnested-externs
70KBUILD_EXTRA_WARNINGS += $(call cc-option, -Wmissing-include-dirs,) 74warning-2 += -Wshadow
71KBUILD_EXTRA_WARNINGS += -Wmissing-prototypes 75warning-2 += $(call cc-option, -Wlogical-op)
72KBUILD_EXTRA_WARNINGS += -Wnested-externs 76
73KBUILD_EXTRA_WARNINGS += -Wold-style-definition 77warning-3 := -Wbad-function-cast
74KBUILD_EXTRA_WARNINGS += $(call cc-option, -Woverlength-strings,) 78warning-3 += -Wcast-qual
75KBUILD_EXTRA_WARNINGS += -Wpacked 79warning-3 += -Wconversion
76KBUILD_EXTRA_WARNINGS += -Wpacked-bitfield-compat 80warning-3 += -Wpacked
77KBUILD_EXTRA_WARNINGS += -Wpadded 81warning-3 += -Wpadded
78KBUILD_EXTRA_WARNINGS += -Wpointer-arith 82warning-3 += -Wpointer-arith
79KBUILD_EXTRA_WARNINGS += -Wredundant-decls 83warning-3 += -Wredundant-decls
80KBUILD_EXTRA_WARNINGS += -Wshadow 84warning-3 += -Wswitch-default
81KBUILD_EXTRA_WARNINGS += -Wswitch-default 85warning-3 += $(call cc-option, -Wpacked-bitfield-compat)
82KBUILD_EXTRA_WARNINGS += $(call cc-option, -Wvla,) 86warning-3 += $(call cc-option, -Wvla)
83KBUILD_CFLAGS += $(KBUILD_EXTRA_WARNINGS) 87
88warning := $(warning-$(KBUILD_ENABLE_EXTRA_GCC_CHECKS))
89
90ifeq ("$(warning)","")
91 $(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown)
92endif
93
94KBUILD_CFLAGS += $(warning)
84endif 95endif
85 96
86include scripts/Makefile.lib 97include scripts/Makefile.lib