Re: [PATCH] bug: shut up format attribute warning for clang as well

From: Arnd Bergmann

Date: Mon Mar 23 2026 - 16:58:02 EST


On Mon, Mar 23, 2026, at 21:45, Andrew Morton wrote:
> On Mon, 23 Mar 2026 16:38:14 +0100 "Arnd Bergmann" <arnd@xxxxxxxx> wrote:
>
>> On Mon, Mar 23, 2026, at 11:54, Brendan Jackman wrote:
>> > On Fri Mar 20, 2026 at 9:14 PM UTC, Arnd Bergmann wrote:
>> >
>> > There is actually a superior fix for this warning that Andy Schevchenko
>> > posted here (mine just happened to get merged first):
>> >
>> > https://lore.kernel.org/all/20251208141618.2805983-1-andriy.shevchenko@xxxxxxxxxxxxxxx/T/#u
>> >
>> > Should we just switch over to that? Looks like it should work for both
>> > compilers.
>>
>> Right, I tried that again and it works. I had confused it with the
>> similar logic to disable the warning on va_format(), which is
>> not that easy to avoid.
>>
>
> What I think I'm hearing is that we should revert Brendan's
> d36067d6ea00 ("bug: Hush suggest-attribute=format for __warn_printf()")
> then apply Andy's
> https://lore.kernel.org/all/20251208141618.2805983-1-andriy.shevchenko@xxxxxxxxxxxxxxx/T/#u,
> yes?
>
> Could someone please prepare a suitably changelogged and tested patch
> for that?

I now sent the version that I had in my tree already as a v2
of my patch. I tested this with gcc-16 and clang-22 in random
configurations.

Arnd