diff options
author | Behan Webster <behanw@converseincode.com> | 2014-08-01 00:08:25 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2014-08-05 09:40:01 -0400 |
commit | 26ea6bb1fef06c686be771903ecab0518af5c2de (patch) | |
tree | 9e74b8c2f493bffb2f721be4b1b831d2866663b7 /scripts | |
parent | bfaf2dd3509bc73bf4a4cea0e72472755ed860e2 (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.extrawarn | 21 |
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) | |||
26 | warning-1 += $(call cc-option, -Wunused-but-set-variable) | 26 | warning-1 += $(call cc-option, -Wunused-but-set-variable) |
27 | warning-1 += $(call cc-disable-warning, missing-field-initializers) | 27 | warning-1 += $(call cc-disable-warning, missing-field-initializers) |
28 | 28 | ||
29 | # Clang | ||
30 | warning-1 += $(call cc-disable-warning, initializer-overrides) | ||
31 | warning-1 += $(call cc-disable-warning, unused-value) | ||
32 | warning-1 += $(call cc-disable-warning, format) | ||
33 | warning-1 += $(call cc-disable-warning, unknown-warning-option) | ||
34 | warning-1 += $(call cc-disable-warning, sign-compare) | ||
35 | warning-1 += $(call cc-disable-warning, format-zero-length) | ||
36 | warning-1 += $(call cc-disable-warning, uninitialized) | ||
37 | warning-1 += $(call cc-option, -fcatch-undefined-behavior) | ||
38 | |||
39 | warning-2 := -Waggregate-return | 29 | warning-2 := -Waggregate-return |
40 | warning-2 += -Wcast-align | 30 | warning-2 += -Wcast-align |
41 | warning-2 += -Wdisabled-optimization | 31 | warning-2 += -Wdisabled-optimization |
@@ -64,4 +54,15 @@ ifeq ("$(strip $(warning))","") | |||
64 | endif | 54 | endif |
65 | 55 | ||
66 | KBUILD_CFLAGS += $(warning) | 56 | KBUILD_CFLAGS += $(warning) |
57 | else | ||
58 | |||
59 | ifeq ($(COMPILER),clang) | ||
60 | KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides) | ||
61 | KBUILD_CFLAGS += $(call cc-disable-warning, unused-value) | ||
62 | KBUILD_CFLAGS += $(call cc-disable-warning, format) | ||
63 | KBUILD_CFLAGS += $(call cc-disable-warning, unknown-warning-option) | ||
64 | KBUILD_CFLAGS += $(call cc-disable-warning, sign-compare) | ||
65 | KBUILD_CFLAGS += $(call cc-disable-warning, format-zero-length) | ||
66 | KBUILD_CFLAGS += $(call cc-disable-warning, uninitialized) | ||
67 | endif | ||
67 | endif | 68 | endif |