Commit 26ea6bb1 authored by Behan Webster's avatar Behan Webster Committed by Michal Marek

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: default avatarBehan Webster <behanw@converseincode.com>
Signed-off-by: default avatarJan-Simon Möller <dl9pf@gmx.de>
Signed-off-by: default avatarMark Charlebois <charlebm@gmail.com>
Cc: bp@alien8.de
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
parent bfaf2dd3
...@@ -663,6 +663,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare) ...@@ -663,6 +663,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
# source of a reference will be _MergedGlobals and not on of the whitelisted names. # source of a reference will be _MergedGlobals and not on of the whitelisted names.
# See modpost pattern 2 # See modpost pattern 2
KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,) KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
else else
# This warning generated too much noise in a regular build. # This warning generated too much noise in a regular build.
......
...@@ -26,16 +26,6 @@ warning-1 += $(call cc-option, -Wmissing-include-dirs) ...@@ -26,16 +26,6 @@ warning-1 += $(call cc-option, -Wmissing-include-dirs)
warning-1 += $(call cc-option, -Wunused-but-set-variable) warning-1 += $(call cc-option, -Wunused-but-set-variable)
warning-1 += $(call cc-disable-warning, missing-field-initializers) warning-1 += $(call cc-disable-warning, missing-field-initializers)
# Clang
warning-1 += $(call cc-disable-warning, initializer-overrides)
warning-1 += $(call cc-disable-warning, unused-value)
warning-1 += $(call cc-disable-warning, format)
warning-1 += $(call cc-disable-warning, unknown-warning-option)
warning-1 += $(call cc-disable-warning, sign-compare)
warning-1 += $(call cc-disable-warning, format-zero-length)
warning-1 += $(call cc-disable-warning, uninitialized)
warning-1 += $(call cc-option, -fcatch-undefined-behavior)
warning-2 := -Waggregate-return warning-2 := -Waggregate-return
warning-2 += -Wcast-align warning-2 += -Wcast-align
warning-2 += -Wdisabled-optimization warning-2 += -Wdisabled-optimization
...@@ -64,4 +54,15 @@ ifeq ("$(strip $(warning))","") ...@@ -64,4 +54,15 @@ ifeq ("$(strip $(warning))","")
endif endif
KBUILD_CFLAGS += $(warning) KBUILD_CFLAGS += $(warning)
else
ifeq ($(COMPILER),clang)
KBUILD_CFLAGS += $(call cc-disable-warning, initializer-overrides)
KBUILD_CFLAGS += $(call cc-disable-warning, unused-value)
KBUILD_CFLAGS += $(call cc-disable-warning, format)
KBUILD_CFLAGS += $(call cc-disable-warning, unknown-warning-option)
KBUILD_CFLAGS += $(call cc-disable-warning, sign-compare)
KBUILD_CFLAGS += $(call cc-disable-warning, format-zero-length)
KBUILD_CFLAGS += $(call cc-disable-warning, uninitialized)
endif
endif endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment