From: "Arnd Bergmann" <arnd@arndb.de>
To: "Alexei Starovoitov" <alexei.starovoitov@gmail.com>,
"Arnd Bergmann" <arnd@kernel.org>
Cc: "Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Song Liu" <song@kernel.org>, "KP Singh" <kpsingh@kernel.org>,
"Matt Bobrowski" <mattbobrowski@google.com>,
"Steven Rostedt" <rostedt@goodmis.org>,
"Masami Hiramatsu" <mhiramat@kernel.org>,
"Martin KaFai Lau" <martin.lau@linux.dev>,
"Eduard Zingerman" <eddyz87@gmail.com>,
"Yonghong Song" <yonghong.song@linux.dev>,
"John Fastabend" <john.fastabend@gmail.com>,
"Stanislav Fomichev" <sdf@fomichev.me>,
"Hao Luo" <haoluo@google.com>, "Jiri Olsa" <jolsa@kernel.org>,
"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>,
"Mykyta Yatsenko" <yatsenko@meta.com>,
"Kumar Kartikeya Dwivedi" <memxor@gmail.com>,
bpf <bpf@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>,
linux-trace-kernel <linux-trace-kernel@vger.kernel.org>
Subject: Re: [PATCH] bpf: add missing __printf attributes
Date: Tue, 03 Feb 2026 17:57:58 +0100 [thread overview]
Message-ID: <5f9c89fe-df1d-4eb4-b724-08f8d90fcc59@app.fastmail.com> (raw)
In-Reply-To: <CAADnVQ+14yum8okMmjuqF5m5DafWo1fY1EuPj-QU_ykYbQ01uw@mail.gmail.com>
On Tue, Feb 3, 2026, at 17:34, Alexei Starovoitov wrote:
> On Tue, Feb 3, 2026 at 8:27 AM Arnd Bergmann <arnd@kernel.org> wrote:
>>
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> Some internal functions in bpf produce a warning when -Wsuggest-attribute=format
>> is passed to the compiler, e.g. in 'make W=1':
>>
>> kernel/trace/bpf_trace.c: In function '____bpf_trace_printk':
>> kernel/trace/bpf_trace.c:377:9: error: function '____bpf_trace_printk' might be a candidate for 'gnu_printf' format attribute [-Werror=suggest-attribute=format]
>> 377 | ret = bstr_printf(data.buf, MAX_BPRINTF_BUF, fmt, data.bin_args);
>> | ^~~
>>
>> The attribute here is useless since there are no callers from C code,
>> but it helps to shut up the output anyway so we can eventually turn
>> the warning option on by default.
>>
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> This was discussed and it's incorrect.
Do you have a reference to why it's incorrect? It seems harmless
and gives me a clean kernel build in combination with a handful
of other fixes after enabling the option by default, but I assume
I'm missing something,
> Commit 7bf819aa992f ("vsnprintf: Mark binary printing functions with
> __printf() attribute") should be reverted instead.
Reverting that one would appear to introduce warnings elsewhere,
so that would not be a complete fix either.
Arnd
next prev parent reply other threads:[~2026-02-03 16:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-03 16:27 Arnd Bergmann
2026-02-03 16:34 ` Alexei Starovoitov
2026-02-03 16:57 ` Arnd Bergmann [this message]
2026-02-03 17:24 ` Alexei Starovoitov
2026-02-03 17:44 ` Arnd Bergmann
2026-02-03 18:11 ` Alexei Starovoitov
2026-02-03 23:21 ` Arnd Bergmann
2026-02-04 0:33 ` Alexei Starovoitov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5f9c89fe-df1d-4eb4-b724-08f8d90fcc59@app.fastmail.com \
--to=arnd@arndb.de \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=arnd@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=mathieu.desnoyers@efficios.com \
--cc=mattbobrowski@google.com \
--cc=memxor@gmail.com \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
--cc=sdf@fomichev.me \
--cc=song@kernel.org \
--cc=yatsenko@meta.com \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®