[merged] scripts-makefileextrawarn-do-not-show-clangs-non-kprintf-warnings-at-w=1.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The quilt patch titled
     Subject: scripts/Makefile.extrawarn: do not show clang's non-kprintf warnings at W=1
has been removed from the -mm tree.  Its filename was
     scripts-makefileextrawarn-do-not-show-clangs-non-kprintf-warnings-at-w=1.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Nathan Chancellor <nathan@xxxxxxxxxx>
Subject: scripts/Makefile.extrawarn: do not show clang's non-kprintf warnings at W=1
Date: Fri, 31 Jan 2025 15:55:28 -0700

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.

Link: https://lkml.kernel.org/r/20250131-makefile-extrawarn-fix-clang-format-non-kprintf-v1-1-6c6747ada0d4@xxxxxxxxxx
Fixes: 908dd508276d ("kbuild: enable -Wformat-truncation on clang")
Signed-off-by: Nathan Chancellor <nathan@xxxxxxxxxx>
Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202501291646.VtwF98qd-lkp@xxxxxxxxx/
Cc: Andriy Shevchenko <andy.shevchenko@xxxxxxxxx>
Cc: Arnd Bergmann <arnd@xxxxxxxx>
Cc: Masahiro Yamada <masahiroy@xxxxxxxxxx>
Cc: Nicolas Schier <nicolas@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 scripts/Makefile.extrawarn |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- a/scripts/Makefile.extrawarn~scripts-makefileextrawarn-do-not-show-clangs-non-kprintf-warnings-at-w=1
+++ a/scripts/Makefile.extrawarn
@@ -31,6 +31,11 @@ KBUILD_CFLAGS-$(CONFIG_CC_NO_ARRAY_BOUND
 ifdef CONFIG_CC_IS_CLANG
 # The kernel builds with '-std=gnu11' so use of GNU extensions is acceptable.
 KBUILD_CFLAGS += -Wno-gnu
+
+# Clang checks for overflow/truncation with '%p', while GCC does not:
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111219
+KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow-non-kprintf)
+KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation-non-kprintf)
 else
 
 # gcc inanely warns about local variables called 'main'
@@ -102,11 +107,6 @@ KBUILD_CFLAGS += $(call cc-disable-warni
 KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow)
 ifdef CONFIG_CC_IS_GCC
 KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation)
-else
-# Clang checks for overflow/truncation with '%p', while GCC does not:
-# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111219
-KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow-non-kprintf)
-KBUILD_CFLAGS += $(call cc-disable-warning, format-truncation-non-kprintf)
 endif
 KBUILD_CFLAGS += $(call cc-disable-warning, stringop-truncation)
 
_

Patches currently in -mm which might be from nathan@xxxxxxxxxx are






[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux