Skip to content

Commit 5a41237

Browse files
committed
gcc: disable -Warray-bounds for gcc-11 too
We had already disabled this warning for gcc-12 due to bugs in the value range analysis, but it turns out we end up having some similar problems with gcc-11.3 too, so let's disable it there too. Older gcc versions end up being increasingly less relevant, and hopefully clang and newer version of gcc (ie gcc-13) end up working reliably enough that we still get the build coverage even when we disable this for some versions. Link: https://lore.kernel.org/all/[email protected]/ Link: https://lore.kernel.org/all/[email protected]/ Cc: Kees Cook <[email protected]> Cc: Vlastimil Babka <[email protected]> Cc: Guenter Roeck <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 1fe4fd6 commit 5a41237

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

init/Kconfig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,13 +894,17 @@ config CC_IMPLICIT_FALLTHROUGH
894894
default "-Wimplicit-fallthrough=5" if CC_IS_GCC && $(cc-option,-Wimplicit-fallthrough=5)
895895
default "-Wimplicit-fallthrough" if CC_IS_CLANG && $(cc-option,-Wunreachable-code-fallthrough)
896896

897-
# Currently, disable gcc-12 array-bounds globally.
897+
# Currently, disable gcc-11,12 array-bounds globally.
898898
# We may want to target only particular configurations some day.
899+
config GCC11_NO_ARRAY_BOUNDS
900+
def_bool y
901+
899902
config GCC12_NO_ARRAY_BOUNDS
900903
def_bool y
901904

902905
config CC_NO_ARRAY_BOUNDS
903906
bool
907+
default y if CC_IS_GCC && GCC_VERSION >= 110000 && GCC_VERSION < 120000 && GCC11_NO_ARRAY_BOUNDS
904908
default y if CC_IS_GCC && GCC_VERSION >= 120000 && GCC_VERSION < 130000 && GCC12_NO_ARRAY_BOUNDS
905909

906910
#

0 commit comments

Comments
 (0)