Commit 3d3d6b84 authored by Jan-Simon Möller's avatar Jan-Simon Möller Committed by Behan Webster

kbuild: LLVMLinux: Adapt warnings for compilation with clang

When compiling kernel with clang, disable warnings which are too noisy, and
add the clang flag catch-undefined-behavior.
Signed-off-by: default avatarJan-Simon Möller <dl9pf@gmx.de>
Signed-off-by: default avatarBehan Webster <behanw@converseincode.com>
Signed-off-by: default avatarMark Charlebois <mcharleb@gmail.com>
Cc: PaX Team <pageexec@freemail.hu>
parent 61163efa
...@@ -65,12 +65,22 @@ warning- := $(empty) ...@@ -65,12 +65,22 @@ warning- := $(empty)
warning-1 := -Wextra -Wunused -Wno-unused-parameter warning-1 := -Wextra -Wunused -Wno-unused-parameter
warning-1 += -Wmissing-declarations warning-1 += -Wmissing-declarations
warning-1 += -Wmissing-format-attribute warning-1 += -Wmissing-format-attribute
warning-1 += -Wmissing-prototypes warning-1 += $(call cc-option, -Wmissing-prototypes)
warning-1 += -Wold-style-definition warning-1 += -Wold-style-definition
warning-1 += $(call cc-option, -Wmissing-include-dirs) 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
......
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