Re: [PATCH 0/2] vsprintf: Use __diag macros to disable '-Wsuggest-attribute=format'

From: David Laight
Date: Sat Apr 05 2025 - 05:13:54 EST


On Fri, 04 Apr 2025 15:10:01 -0700
Nathan Chancellor <nathan@xxxxxxxxxx> wrote:

> Hi all,
>
> This is a follow up to the complaint that Linus made at [1] about how
> the #pragma and #ifdef to disable -Wsuggest-attribute=format is
> currently ugly. Convert the #pragma and #ifdef to the existing __diag()
> infrastructure in the kernel to hide some of the ugliness.

It's still horribly ugly.

Perhaps the compilers ought to support __attribute__((format(none)))
to disable the warning.
And then disable it for older compilers.

David