Re: [PATCH] libbpf: workaround (another) -Wmaybe-uninitialized false positive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello:

This patch was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <andrii@xxxxxxxxxx>:

On Fri,  6 Sep 2024 14:48:14 +0100 you wrote:
> We get this with GCC 15 -O3 (at least):
> ```
> libbpf.c: In function ‘bpf_map__init_kern_struct_ops’:
> libbpf.c:1109:18: error: ‘mod_btf’ may be used uninitialized [-Werror=maybe-uninitialized]
>  1109 |         kern_btf = mod_btf ? mod_btf->btf : obj->btf_vmlinux;
>       |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> libbpf.c:1094:28: note: ‘mod_btf’ was declared here
>  1094 |         struct module_btf *mod_btf;
>       |                            ^~~~~~~
> In function ‘find_struct_ops_kern_types’,
>     inlined from ‘bpf_map__init_kern_struct_ops’ at libbpf.c:1102:8:
> libbpf.c:982:21: error: ‘btf’ may be used uninitialized [-Werror=maybe-uninitialized]
>   982 |         kern_type = btf__type_by_id(btf, kern_type_id);
>       |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> libbpf.c: In function ‘bpf_map__init_kern_struct_ops’:
> libbpf.c:967:21: note: ‘btf’ was declared here
>   967 |         struct btf *btf;
>       |                     ^~~
> ```
> 
> [...]

Here is the summary with links:
  - libbpf: workaround (another) -Wmaybe-uninitialized false positive
    https://git.kernel.org/bpf/bpf-next/c/8a3f14bb1e94

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html






[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux