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 <>
Signed-off-by: default avatarJan-Simon Möller <>
Signed-off-by: default avatarMark Charlebois <>
Signed-off-by: default avatarMichal Marek <>
parent bfaf2dd3
......@@ -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.
# See modpost pattern 2
KBUILD_CFLAGS += $(call cc-option, -mno-global-merge,)
KBUILD_CFLAGS += $(call cc-option, -fcatch-undefined-behavior)
# This warning generated too much noise in a regular build.
......@@ -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-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 += -Wcast-align
warning-2 += -Wdisabled-optimization
......@@ -64,4 +54,15 @@ ifeq ("$(strip $(warning))","")
KBUILD_CFLAGS += $(warning)
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)
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