* [PROBLEM linux-next] /kernel/bpf/btf.c:7581:9: error: function ‘btf_snprintf_show’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]
@ 2024-07-10 18:14 Mirsad Todorovac
2024-07-11 18:26 ` Alan Maguire
0 siblings, 1 reply; 2+ messages in thread
From: Mirsad Todorovac @ 2024-07-10 18:14 UTC (permalink / raw)
To: Linux Kernel Mailing List
Cc: Martin KaFai Lau, Alexei Starovoitov, Daniel Borkmann,
Andrii Nakryiko, Eduard Zingerman, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
bpf
Dear all,
On the linux-next vanilla next-20240709 tree, I have attempted the seed KCONFIG_SEED=0xEE7AB52F
which was known from before to trigger various errors in compile and build process.
Though this might seem as contributing to channel noise, Linux refuses to build this config,
treating warnings as errors, using this build line:
$ time nice make W=1 -k -j 36 |& tee ../err-next-20230709-01a.log; date
As I know that the Chief Penguin doesn't like warnings, but I am also aware that there are plenty
left, there seems to be more tedious work ahead to make the compilers happy.
The compiler output is:
./kernel/bpf/btf.c: In function ‘btf_seq_show’:
./kernel/bpf/btf.c:7544:29: error: function ‘btf_seq_show’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]
7544 | seq_vprintf((struct seq_file *)show->target, fmt, args);
| ^~~~~~~~
./kernel/bpf/btf.c: In function ‘btf_snprintf_show’:
./kernel/bpf/btf.c:7581:9: error: function ‘btf_snprintf_show’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]
7581 | len = vsnprintf(show->target, ssnprintf->len_left, fmt, args);
| ^~~
This doesn't seem alarming, but it prevents build with this config.
7541 static void btf_seq_show(struct btf_show *show, const char *fmt,
7542 va_list args)
7543 {
7544 → seq_vprintf((struct seq_file *)show->target, fmt, args);
7545 }
7546
7575 static void btf_snprintf_show(struct btf_show *show, const char *fmt,
7576 va_list args)
7577 {
7578 struct btf_show_snprintf *ssnprintf = (struct btf_show_snprintf *)show;
7579 int len;
7580
7581 → len = vsnprintf(show->target, ssnprintf->len_left, fmt, args);
7582
7583 if (len < 0) {
7584 ssnprintf->len_left = 0;
7585 ssnprintf->len = len;
7586 } else if (len >= ssnprintf->len_left) {
7587 /* no space, drive on to get length we would have written */
7588 ssnprintf->len_left = 0;
7589 ssnprintf->len += len;
7590 } else {
7591 ssnprintf->len_left -= len;
7592 ssnprintf->len += len;
7593 show->target += len;
7594 }
7595 }
Hope this helps.
Best regards,
Mirsad Todorovac
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PROBLEM linux-next] /kernel/bpf/btf.c:7581:9: error: function ‘btf_snprintf_show’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]
2024-07-10 18:14 [PROBLEM linux-next] /kernel/bpf/btf.c:7581:9: error: function ‘btf_snprintf_show’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format] Mirsad Todorovac
@ 2024-07-11 18:26 ` Alan Maguire
0 siblings, 0 replies; 2+ messages in thread
From: Alan Maguire @ 2024-07-11 18:26 UTC (permalink / raw)
To: Mirsad Todorovac, Linux Kernel Mailing List
Cc: Martin KaFai Lau, Alexei Starovoitov, Daniel Borkmann,
Andrii Nakryiko, Eduard Zingerman, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
bpf
On 10/07/2024 19:14, Mirsad Todorovac wrote:
> Dear all,
>
> On the linux-next vanilla next-20240709 tree, I have attempted the seed KCONFIG_SEED=0xEE7AB52F
> which was known from before to trigger various errors in compile and build process.
>
> Though this might seem as contributing to channel noise, Linux refuses to build this config,
> treating warnings as errors, using this build line:
>
> $ time nice make W=1 -k -j 36 |& tee ../err-next-20230709-01a.log; date
>
> As I know that the Chief Penguin doesn't like warnings, but I am also aware that there are plenty
> left, there seems to be more tedious work ahead to make the compilers happy.
>
> The compiler output is:
>
> ./kernel/bpf/btf.c: In function ‘btf_seq_show’:
> ./kernel/bpf/btf.c:7544:29: error: function ‘btf_seq_show’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]
> 7544 | seq_vprintf((struct seq_file *)show->target, fmt, args);
> | ^~~~~~~~
> ./kernel/bpf/btf.c: In function ‘btf_snprintf_show’:
> ./kernel/bpf/btf.c:7581:9: error: function ‘btf_snprintf_show’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format]
> 7581 | len = vsnprintf(show->target, ssnprintf->len_left, fmt, args);
> | ^~~
>
> This doesn't seem alarming, but it prevents build with this config.
>
Thanks for the report! [1] should hopefully resolve this.
[1]
https://lore.kernel.org/bpf/20240711182321.963667-1-alan.maguire@oracle.com/
Alan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-11 18:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-10 18:14 [PROBLEM linux-next] /kernel/bpf/btf.c:7581:9: error: function ‘btf_snprintf_show’ might be a candidate for ‘gnu_printf’ format attribute [-Werror=suggest-attribute=format] Mirsad Todorovac
2024-07-11 18:26 ` Alan Maguire
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox