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

From: Peter Zijlstra

Date: Mon Dec 08 2025 - 04:08:41 EST


On Mon, Dec 08, 2025 at 08:50:17AM +0000, Brendan Jackman wrote:
> On Mon Dec 8, 2025 at 8:38 AM UTC, Peter Zijlstra wrote:
> > On Sun, Dec 07, 2025 at 03:53:18AM +0000, Brendan Jackman 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().
> >
> > No real objection, but why haven't I seen this in my own builds? Most of
> > my machines are on gcc-14 / gcc-15.
>
> Ah, yeah, apparently it only shows up with W=1.

*sigh*, one of them.

Ok, thanks!