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

From: David Laight
Date: Tue Dec 16 2025 - 07:43:56 EST


On Tue, 16 Dec 2025 09:16:41 +0000
Brendan Jackman <jackmanb@xxxxxxxxxx> wrote:

...
> Given the kernel is usually W=1 clean, it seems like we _do_ support it.
> It's just that we support it via these akwkward retroactive fixups
> instead of just expecting code to be W=1-clean before we merge it?

It's not that W=1 clean, the bot remembers which warnings it has seen and
only reports new ones.

There are some entirely annoying ones that haven't been moved to W=2.
Some need fixing in the compiler, for instance:
int foo[] = { [0 ... 3 ] = -1, [2] = 1 };
(to change the default initialiser)
generates a warning because [2] is initialised twice.
Any attempt to 'fix' that is likely to leave an unexpected 0 entry.

The 'suggest-attribute-format' one used to give false positives on
some architectures (IIRC including x86) for some vprintf-like functions
because va_list is 'char *'.
That must not be true for kernel builds (any more).

David