Makefile: Enable -Wstringop-overflow globally
PATCH 1/1 Makefile: Enable -Wstringop-overflow globally
It seems that we have finished addressing all the remaining issues regarding compiler option -Wstringop-overflow. So, we are now in good shape to enable this compiler option globally.
--- Makefile | 3 +++ scripts/Makefile.extrawarn | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-)
Makefile +3 -0
@@ -985,6 +985,9 @@ NOSTDINC_FLAGS += -nostdinc # perform bounds checking. KBUILD_CFLAGS += $(call cc-option, -fstrict-flex-arrays=3) +# We are now in good shape to enable this option. +KBUILD_CFLAGS += $(call cc-option, -Wstringop-overflow) + # disable invalid "can't wrap" optimizations for signed / pointers KBUILD_CFLAGS += -fno-strict-overflow
scripts/Makefile.extrawarn +0 -2
@@ -106,7 +106,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
@@ -122,7 +121,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
Signature · 1 line
2.34.1
Quoted 16 lines · Gustavo A. R. Silva
It seems that we have finished addressing all the remaining issues regarding compiler option -Wstringop-overflow. So, we are now in good shape to enable this compiler option globally.
Signed-off-by Gustavo A. R. Silva <[email protected]>--- Makefile | 3 +++ scripts/Makefile.extrawarn | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-)Makefile +0
-0
Makefile NOSTDINC_FLAGS += -nostdinc · line 988
Quoted 4 lines
Makefile +1
-0@@ -985,6 +985,9 @@ NOSTDINC_FLAGS += -nostdinc # perform bounds checking. KBUILD_CFLAGS += $(call cc-option, -fstrict-flex-arrays=3) +# We are now in good shape to enable this option.
Please remove this comment.
It it fine to mention it in the commit log, but
not in the Makefile.
I hope somebody will double-check this patch in CI infrastructure.
Quoted 28 lines
Makefile +2
-0+KBUILD_CFLAGS += $(call cc-option, -Wstringop-overflow) + # disable invalid "can't wrap" optimizations for signed / pointers KBUILD_CFLAGS += -fno-strict-overflowscripts/Makefile.extrawarn +0
-3@@ -106,7 +106,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@@ -122,7 +121,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 --2.34.1
Signature · 2 lines
Best Regards Masahiro Yamada
Quoted 21 lines · Masahiro Yamada
Quoted 19 lines · Gustavo A. R. Silva
It seems that we have finished addressing all the remaining issues regarding compiler option -Wstringop-overflow. So, we are now in good shape to enable this compiler option globally.
Signed-off-by Gustavo A. R. Silva <[email protected]>--- Makefile | 3 +++ scripts/Makefile.extrawarn | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-)Makefile +0
-0@@ -985,6 +985,9 @@ NOSTDINC_FLAGS += -nostdinc # perform bounds checking. KBUILD_CFLAGS += $(call cc-option, -fstrict-flex-arrays=3)
Quoted 6 lines
Makefile NOSTDINC_FLAGS += -nostdinc · line 988
Quoted 1 line
Makefile +1
-0+# We are now in good shape to enable this option.Please remove this comment.
It it fine to mention it in the commit log, but
not in theMakefile.
Sure thing. I'll change that and add this patch to my -next tree.
Quoted 4 lines
I hope somebody will double-check this patch in CI infrastructure.
I'll take care of that.
Thanks
--
Gustavo
Quoted 34 lines
Quoted 32 lines
Makefile +2
-0+KBUILD_CFLAGS += $(call cc-option, -Wstringop-overflow) + # disable invalid "can't wrap" optimizations for signed / pointers KBUILD_CFLAGS += -fno-strict-overflowscripts/Makefile.extrawarn +0
-3@@ -106,7 +106,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@@ -122,7 +121,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 --2.34.1