[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <176527179323.498.3669459412099769581.tip-bot2@tip-bot2>
Date: Tue, 09 Dec 2025 09:16:32 -0000
From: "tip-bot2 for Brendan Jackman" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Brendan Jackman <jackmanb@...gle.com>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject:
[tip: core/urgent] bug: Hush suggest-attribute=format for __warn_printf()
The following commit has been merged into the core/urgent branch of tip:
Commit-ID: 40f40edaa30137fe7f09752db60a7a6ab4124ef9
Gitweb: https://git.kernel.org/tip/40f40edaa30137fe7f09752db60a7a6ab4124ef9
Author: Brendan Jackman <jackmanb@...gle.com>
AuthorDate: Sun, 07 Dec 2025 03:53:18
Committer: Peter Zijlstra <peterz@...radead.org>
CommitterDate: Tue, 09 Dec 2025 10:14:47 +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 â=80=98__warn_printfâ=80=99:
lib/bug.c:187:25: error: function â__warn_printfâ might 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@...gle.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.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)
{
Powered by blists - more mailing lists