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

From: Peter Zijlstra
Date: Mon Dec 08 2025 - 03:39:53 EST


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.