[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250324152012.413380d8@gandalf.local.home>
Date: Mon, 24 Mar 2025 15:20:12 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Christophe JAILLET <christophe.jaillet@...adoo.fr>, Kees Cook
<kees@...nel.org>, "Masami Hiramatsu (Google)" <mhiramat@...nel.org>,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org,
linux-trace-kernel@...r.kernel.org, Andy Shevchenko <andy@...nel.org>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, Andrew Morton
<akpm@...ux-foundation.org>, Petr Mladek <pmladek@...e.com>, Rasmus
Villemoes <linux@...musvillemoes.dk>, Sergey Senozhatsky
<senozhatsky@...omium.org>
Subject: Re: [PATCH v2 4/6] vsnprintf: Mark binary printing functions with
__printf() attribute
On Fri, 21 Mar 2025 16:40:50 +0200
Andy Shevchenko <andriy.shevchenko@...ux.intel.com> wrote:
> Binary printf() functions are using printf() type of format, and compiler
> is not happy about them as is:
>
> lib/vsprintf.c:3130:47: error: function ‘vbin_printf’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]
> lib/vsprintf.c:3298:33: error: function ‘bstr_printf’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]
BTW, I find it disturbing that the compiler is set to "error" on a warning
that "might be a candidate". What happens if it is not? We have to play
games to quiet it.
Adding __printf() attributes to stubs seems to be a case of the compiler
causing more problems than its worth :-/
I honestly hate this error on warning because it causes real pain when
debugging. There's a lot of times I don't know if the value is long or long
long, and when I get it wrong, my printk() causes the build to fail. It's
especially annoying when both long and long long are the same size!
Fixing theses stupid errors takes a non trivial amount of time away from
actual debugging.
-- Steve
>
> Fix the compilation errors by adding __printf() attribute.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Powered by blists - more mailing lists