aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorBehan Webster <behanw@converseincode.com>2014-08-01 00:08:25 -0400
committerMichal Marek <mmarek@suse.cz>2014-08-05 09:40:01 -0400
commit26ea6bb1fef06c686be771903ecab0518af5c2de (patch)
tree9e74b8c2f493bffb2f721be4b1b831d2866663b7 /scripts
parentbfaf2dd3509bc73bf4a4cea0e72472755ed860e2 (diff)
kbuild, LLVMLinux: Supress warnings unless W=1-3
clang has more warnings enabled by default. Turn them off unless W is set. This patch fixes a logic bug where warnings in clang were disabled when W was set. Signed-off-by: Behan Webster <behanw@converseincode.com> Signed-off-by: Jan-Simon Möller <dl9pf@gmx.de> Signed-off-by: Mark Charlebois <charlebm@gmail.com> Cc: bp@alien8.de Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.extrawarn21
1 files changed, 11 insertions, 10 deletions
diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn
index 65643506c71c..f734033af219 100644
--- a/scripts/Makefile.extrawarn
+++ b/scripts/Makefile.extrawarn
@@ -26,16 +26,6 @@ warning-1 += $(call cc-option, -Wmissing-include-dirs)
26warning-1 += $(call cc-option, -Wunused-but-set-variable) 26warning-1 += $(call cc-option, -Wunused-but-set-variable)
27warning-1 += $(call cc-disable-warning, missing-field-initializers) 27warning-1 += $(call cc-disable-warning, missing-field-initializers)
28 28
29# Clang
30warning-1 += $(call cc-disable-warning, initializer-overrides)
31warning-1 += $(call cc-disable-warning, unused-value)
32warning-1 += $(call cc-disable-warning, format)
33warning-1 += $(call cc-disable-warning, unknown-warning-option)
34warning-1 += $(call cc-disable-warning, sign-compare)
35warning-1 += $(call cc-disable-warning, format-zero-length)
36warning-1 += $(call cc-disable-warning, uninitialized)
37warning-1 += $(call cc-option, -fcatch-undefined-behavior)
38
39warning-2 := -Waggregate-return 29warning-2 := -Waggregate-return
40warning-2 += -Wcast-align 30warning-2 += -Wcast-align
41warning-2 += -Wdisabled-optimization 31warning-2 += -Wdisabled-optimization
@@ -64,4 +54,15 @@ ifeq ("$(strip $(warning))","")
64endif 54endif
65 55
66KBUILD_CFLAGS += $(warning) 56KBUILD_CFLAGS += $(warning)
57else
58
59ifeq ($(COMPILER),clang)
60KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides)
61KBUILD_CFLAGS += $(call cc-disable-warning, unused-value)
62KBUILD_CFLAGS += $(call cc-disable-warning, format)
63KBUILD_CFLAGS += $(call cc-disable-warning, unknown-warning-option)
64KBUILD_CFLAGS += $(call cc-disable-warning, sign-compare)
65KBUILD_CFLAGS += $(call cc-disable-warning, format-zero-length)
66KBUILD_CFLAGS += $(call cc-disable-warning, uninitialized)
67endif
67endif 68endif