Re: [PATCH] bug: hush suggest-attribute=format for __warn_printf()

From: Peter Zijlstra
Date: Tue Dec 16 2025 - 03:55:30 EST


On Mon, Dec 15, 2025 at 08:24:30PM -0800, Andrew Morton wrote:
> On Sun, 07 Dec 2025 03:53:18 +0000 Brendan Jackman <jackmanb@xxxxxxxxxx> wrote:
>
> > Recent additions to this function cause GCC 14.3.0 to get excited and
> > suggest a missing attribute:
> >
> > lib/bug.c: In function ‘__warn_printf’:
> > 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().
> >
>
> Question please. Why are we suppressing the warning instead of
> addressing it, as Andy attempts to do in
> https://lkml.kernel.org/r/20251208141618.2805983-1-andriy.shevchenko@xxxxxxxxxxxxxxx?
>
> I went off and looked at the commit which did this to va_format() but
> it didn't tell me.

Blergh, I hadn't even noticed Andy's thing was different :/

Fundamentally I'm starting to hate W=1. Either we think these warnings
are good and we should get it into the default build, or we don't think
and we should just collectively ignore them.

This stream of W=1 'fixes' every time is getting really rather tedious.