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]

From: Alan Maguire
Date: Thu Jul 11 2024 - 14:26:48 EST


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@xxxxxxxxxx/

Alan