]> www.infradead.org Git - nvme.git/commit
kbuild: enable -Wformat-truncation on clang
authorArnd Bergmann <arnd@arndb.de>
Mon, 15 Apr 2024 12:20:35 +0000 (14:20 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 19 May 2024 21:36:16 +0000 (14:36 -0700)
commit908dd508276da13a9b50c208577365d26692eb43
tree02ddcfbba4205018c1aca716d3c184d8c3d016af
parent06bb7fc0feee32d95abc51c3226f598f30eaa261
kbuild: enable -Wformat-truncation on clang

This warning option still produces output on gcc but is now clean when
building with clang, so enable it conditionally on the compiler for now.

As far as I can tell, the remaining warnings with gcc are the result of
analysing the code more deeply across inlining, while clang only does this
within a function.

Link: https://lore.kernel.org/lkml/20240326230511.GA2796782@dev-arch.thelio-3990X/
Link: https://lore.kernel.org/linux-patches/20231002-disable-wformat-truncation-overflow-non-kprintf-v1-1-35179205c8d9@kernel.org/
Link: https://lkml.kernel.org/r/20240415122037.1983124-5-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Kees Cook <keescook@chromium.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nicolas Schier <nicolas@fjasle.eu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
scripts/Makefile.extrawarn