From: "tip-bot2 for Brendan Jackman" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Brendan Jackman <jackmanb@google.com>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: core/urgent] bug: Hush suggest-attribute=format for __warn_printf()
Date: Fri, 12 Dec 2025 09:10:39 -0000 [thread overview]
Message-ID: <176553063981.498.7621766354621505897.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20251207-warn-printf-gcc-v1-1-b597d612b94b@google.com>
The following commit has been merged into the core/urgent branch of tip:
Commit-ID: 41a1dcfb7ade1051bdc6e4923099699f45fcbb10
Gitweb: https://git.kernel.org/tip/41a1dcfb7ade1051bdc6e4923099699f45fcbb10
Author: Brendan Jackman <jackmanb@google.com>
AuthorDate: Sun, 07 Dec 2025 03:53:18
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Fri, 12 Dec 2025 10:06:02 +01:00
bug: Hush suggest-attribute=format for __warn_printf()
Recent additions to this function cause GCC 14.3.0 to get excited
(W=1) and suggest a missing attribute:
lib/bug.c: In function '__warn_printf':
lib/bug.c:187:25: error: function '__warn_printf' be a candidate for 'gnu_printf' format attribute [-Werror=suggest-attribute=format]
187 | vprintk(fmt, *args);
| ^~~~~~~
Disable the diagnostic locally, following the pattern used for stuff
like va_format().
Fixes: 5c47b7f3d1a9 ("bug: Add BUG_FORMAT_ARGS infrastructure")
Signed-off-by: Brendan Jackman <jackmanb@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://patch.msgid.link/20251207-warn-printf-gcc-v1-1-b597d612b94b@google.com
---
lib/bug.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/bug.c b/lib/bug.c
index c6f691f..623c467 100644
--- a/lib/bug.c
+++ b/lib/bug.c
@@ -173,6 +173,9 @@ struct bug_entry *find_bug(unsigned long bugaddr)
return module_find_bug(bugaddr);
}
+__diag_push();
+__diag_ignore(GCC, all, "-Wsuggest-attribute=format",
+ "Not a valid __printf() conversion candidate.");
static void __warn_printf(const char *fmt, struct pt_regs *regs)
{
if (!fmt)
@@ -192,6 +195,7 @@ static void __warn_printf(const char *fmt, struct pt_regs *regs)
printk("%s", fmt);
}
+__diag_pop();
static enum bug_trap_type __report_bug(struct bug_entry *bug, unsigned long bugaddr, struct pt_regs *regs)
{
next prev parent reply other threads:[~2025-12-12 9:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-07 3:53 [PATCH] bug: hush " Brendan Jackman
2025-12-08 8:38 ` Peter Zijlstra
2025-12-08 8:50 ` Brendan Jackman
2025-12-08 8:58 ` Peter Zijlstra
2025-12-09 9:16 ` [tip: core/urgent] bug: Hush " tip-bot2 for Brendan Jackman
2025-12-12 9:10 ` tip-bot2 for Brendan Jackman [this message]
2025-12-12 9:29 ` tip-bot2 for Brendan Jackman
2025-12-16 4:24 ` [PATCH] bug: hush " Andrew Morton
2025-12-16 8:49 ` Peter Zijlstra
2025-12-16 9:16 ` Brendan Jackman
2025-12-16 12:36 ` David Laight
2025-12-16 12:43 ` Brendan Jackman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=176553063981.498.7621766354621505897.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=jackmanb@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®