File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -986,7 +986,9 @@ NOSTDINC_FLAGS += -nostdinc
986
986
# perform bounds checking.
987
987
KBUILD_CFLAGS += $(call cc-option, -fstrict-flex-arrays=3)
988
988
989
- KBUILD_CFLAGS += $(call cc-option, -Wstringop-overflow)
989
+ # Currently, disable -Wstringop-overflow for GCC 11, globally.
990
+ KBUILD_CFLAGS-$(CONFIG_CC_NO_STRINGOP_OVERFLOW) += $(call cc-option, -Wno-stringop-overflow)
991
+ KBUILD_CFLAGS-$(CONFIG_CC_STRINGOP_OVERFLOW) += $(call cc-option, -Wstringop-overflow)
990
992
991
993
# disable invalid "can't wrap" optimizations for signed / pointers
992
994
KBUILD_CFLAGS += -fno-strict-overflow
Original file line number Diff line number Diff line change @@ -876,6 +876,18 @@ config CC_NO_ARRAY_BOUNDS
876
876
bool
877
877
default y if CC_IS_GCC && GCC_VERSION >= 110000 && GCC11_NO_ARRAY_BOUNDS
878
878
879
+ # Currently, disable -Wstringop-overflow for GCC 11, globally.
880
+ config GCC11_NO_STRINGOP_OVERFLOW
881
+ def_bool y
882
+
883
+ config CC_NO_STRINGOP_OVERFLOW
884
+ bool
885
+ default y if CC_IS_GCC && GCC_VERSION >= 110000 && GCC_VERSION < 120000 && GCC11_NO_STRINGOP_OVERFLOW
886
+
887
+ config CC_STRINGOP_OVERFLOW
888
+ bool
889
+ default y if CC_IS_GCC && !CC_NO_STRINGOP_OVERFLOW
890
+
879
891
#
880
892
# For architectures that know their GCC __int128 support is sound
881
893
#
You can’t perform that action at this time.
0 commit comments