With the few remaining fixes now landed, we can re-enable the option -Wunterminated-string-initialization for GCC. (Clang does not yet fully understand the "nonstring" attribute.)
Signed-off-by: Kees Cook <k...@kernel.org> --- Cc: Masahiro Yamada <masahi...@kernel.org> Cc: Nathan Chancellor <nat...@kernel.org> Cc: Nicolas Schier <nicolas.sch...@linux.dev> Cc: <linux-kbu...@vger.kernel.org> --- scripts/Makefile.extrawarn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/Makefile.extrawarn b/scripts/Makefile.extrawarn index dca175fffcab..7ab8549485a4 100644 --- a/scripts/Makefile.extrawarn +++ b/scripts/Makefile.extrawarn @@ -78,8 +78,10 @@ KBUILD_CFLAGS += $(call cc-option, -Wcast-function-type) KBUILD_CFLAGS-$(CONFIG_CC_NO_STRINGOP_OVERFLOW) += $(call cc-option, -Wno-stringop-overflow) KBUILD_CFLAGS-$(CONFIG_CC_STRINGOP_OVERFLOW) += $(call cc-option, -Wstringop-overflow) +ifdef CONFIG_CC_IS_CLANG # Currently, disable -Wunterminated-string-initialization as broken KBUILD_CFLAGS += $(call cc-option, -Wno-unterminated-string-initialization) +endif # The allocators already balk at large sizes, so silence the compiler # warnings for bounds checks involving those possible values. While -- 2.34.1