mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-02 03:03:00 +09:00
kbuild: compute false-positive -Wmaybe-uninitialized cases in Kconfig
commitb303c6df80upstream. Since -Wmaybe-uninitialized was introduced by GCC 4.7, we have patched various false positives: - commite74fc973b6("Turn off -Wmaybe-uninitialized when building with -Os") turned off this option for -Os. - commit815eb71e71("Kbuild: disable 'maybe-uninitialized' warning for CONFIG_PROFILE_ALL_BRANCHES") turned off this option for CONFIG_PROFILE_ALL_BRANCHES - commita76bcf557e("Kbuild: enable -Wmaybe-uninitialized warning for "make W=1"") turned off this option for GCC < 4.9 Arnd provided more explanation in https://lkml.org/lkml/2017/3/14/903 I think this looks better by shifting the logic from Makefile to Kconfig. Link: https://github.com/ClangBuiltLinux/linux/issues/350 Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com> Tested-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@@ -356,6 +356,7 @@ config PROFILE_ANNOTATED_BRANCHES
|
||||
config PROFILE_ALL_BRANCHES
|
||||
bool "Profile all if conditionals"
|
||||
select TRACE_BRANCH_PROFILING
|
||||
imply CC_DISABLE_WARN_MAYBE_UNINITIALIZED # avoid false positives
|
||||
help
|
||||
This tracer profiles all branch conditions. Every if ()
|
||||
taken in the kernel is recorded whether it hit or miss.
|
||||
|
||||
Reference in New Issue
Block a user