All of lore.kernel.org
 help / color / mirror / Atom feed
* + bug-shut-up-format-attribute-warning-for-clang-as-well.patch added to mm-hotfixes-unstable branch
@ 2026-03-20 23:32 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-03-20 23:32 UTC (permalink / raw)
  To: mm-commits, peterz, nathan, morbo, mingo, justinstitt, jackmanb,
	arnd, akpm


The patch titled
     Subject: lib/bug.c: shut up format attribute warning for clang as well
has been added to the -mm mm-hotfixes-unstable branch.  Its filename is
     bug-shut-up-format-attribute-warning-for-clang-as-well.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/bug-shut-up-format-attribute-warning-for-clang-as-well.patch

This patch will later appear in the mm-hotfixes-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days

------------------------------------------------------
From: Arnd Bergmann <arnd@arndb.de>
Subject: lib/bug.c: shut up format attribute warning for clang as well
Date: Fri, 20 Mar 2026 22:14:25 +0100

Like gcc, clang-22 now also warns about a function that it
incorrectly identifies as a printf-style format:

lib/bug.c:190:22: error: diagnostic behavior may be improved by adding the 'format(printf, 1, 0)' attribute to the declaration of '__warn_printf' [-Werror,-Wmissing-format-attribute]
  179 | static void __warn_printf(const char *fmt, struct pt_regs *regs)
      | __attribute__((format(printf, 1, 0)))
  180 | {
  181 |         if (!fmt)
  182 |                 return;
  183 |
  184 | #ifdef HAVE_ARCH_BUG_FORMAT_ARGS
  185 |         if (regs) {
  186 |                 struct arch_va_list _args;
  187 |                 va_list *args = __warn_args(&_args, regs);
  188 |
  189 |                 if (args) {
  190 |                         vprintk(fmt, *args);
      |                                           ^

Turn off this warning for all compilers and versions.

Link: https://lkml.kernel.org/r/20260320211528.2474389-1-arnd@kernel.org
Fixes: d36067d6ea00 ("bug: Hush suggest-attribute=format for __warn_printf()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Bill Wendling <morbo@google.com>
Cc: Brendan Jackman <jackmanb@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Justin Stitt <justinstitt@google.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 lib/bug.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

--- a/lib/bug.c~bug-shut-up-format-attribute-warning-for-clang-as-well
+++ a/lib/bug.c
@@ -174,8 +174,7 @@ struct bug_entry *find_bug(unsigned long
 }
 
 __diag_push();
-__diag_ignore(GCC, all, "-Wsuggest-attribute=format",
-	      "Not a valid __printf() conversion candidate.");
+__diag_ignore_all("-Wmissing-format-attribute", "Not a valid __printf() conversion candidate.");
 static void __warn_printf(const char *fmt, struct pt_regs *regs)
 {
 	if (!fmt)
_

Patches currently in -mm which might be from arnd@arndb.de are

bug-shut-up-format-attribute-warning-for-clang-as-well.patch
ubsan-turn-off-kmsan-inside-of-ubsan-instrumentation.patch
mm-vmscan-avoid-false-positive-wuninitialized-warning.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-03-20 23:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-20 23:32 + bug-shut-up-format-attribute-warning-for-clang-as-well.patch added to mm-hotfixes-unstable branch Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.