Makefile: Enable -Wstringop-overflow globally
authorGustavo A. R. Silva <gustavoars@kernel.org>
Tue, 31 Oct 2023 23:50:11 +0000 (17:50 -0600)
committerGustavo A. R. Silva <gustavoars@kernel.org>
Sun, 21 Jan 2024 23:45:31 +0000 (17:45 -0600)
It seems that we have finished addressing all the remaining
issues regarding -Wstringop-overflow. So, we are now in good
shape to enable this compiler option globally.

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Makefile
scripts/Makefile.extrawarn

index 9869f57c3fb3e6a37e40aa267737a044a5e099d8..c01cbbb208cab6c3ed31bcca5ba5d252d51f1745 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -986,6 +986,8 @@ NOSTDINC_FLAGS += -nostdinc
 # perform bounds checking.
 KBUILD_CFLAGS += $(call cc-option, -fstrict-flex-arrays=3)
 
+KBUILD_CFLAGS += $(call cc-option, -Wstringop-overflow)
+
 # disable invalid "can't wrap" optimizations for signed / pointers
 KBUILD_CFLAGS  += -fno-strict-overflow
 
index 9b7a37ae28a8818a41dada5d1dc12c5c65c791f9..a9e552a1e9105b5efb559a23e4a2943c102b12a2 100644 (file)
@@ -97,7 +97,6 @@ KBUILD_CFLAGS += $(call cc-option, -Wunused-const-variable)
 KBUILD_CFLAGS += $(call cc-option, -Wpacked-not-aligned)
 KBUILD_CFLAGS += $(call cc-option, -Wformat-overflow)
 KBUILD_CFLAGS += $(call cc-option, -Wformat-truncation)
-KBUILD_CFLAGS += $(call cc-option, -Wstringop-overflow)
 KBUILD_CFLAGS += $(call cc-option, -Wstringop-truncation)
 
 KBUILD_CPPFLAGS += -Wundef
@@ -113,7 +112,6 @@ KBUILD_CFLAGS += $(call cc-disable-warning, restrict)
 KBUILD_CFLAGS += $(call cc-disable-warning, packed-not-aligned)
 KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow)
 KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation)
-KBUILD_CFLAGS += $(call cc-disable-warning, stringop-overflow)
 KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation)
 
 ifdef CONFIG_CC_IS_CLANG