]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
scripts/Makefile.extrawarn: Do not show clang's non-kprintf warnings at W=1
authorNathan Chancellor <nathan@kernel.org>
Fri, 31 Jan 2025 22:55:28 +0000 (15:55 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 13:01:15 +0000 (14:01 +0100)
commit1f5b7a566e5b262fe2e72f35fb0fef7e9bd1225c
tree30d09b88e84b63feb145cbbaa76fd7d8e30474f1
parentaa879ef6d3acf96fa2c7122d0632061d4ea58d48
scripts/Makefile.extrawarn: Do not show clang's non-kprintf warnings at W=1

[ Upstream commit 738fc998b639407346a9e026514f0562301462cd ]

Clang's -Wformat-overflow and -Wformat-truncation have chosen to check
'%p' unlike GCC but it does not know about the kernel's pointer
extensions in lib/vsprintf.c, so the developers split that part of the
warning out for the kernel to disable because there will always be false
positives.

Commit 908dd508276d ("kbuild: enable -Wformat-truncation on clang") did
disabled these warnings but only in a block that would be called when
W=1 was not passed, so they would appear with W=1. Move the disabling of
the non-kprintf warnings to a block that always runs so that they are
never seen, regardless of warning level.

Fixes: 908dd508276d ("kbuild: enable -Wformat-truncation on clang")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202501291646.VtwF98qd-lkp@intel.com/
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
scripts/Makefile.extrawarn