Re: [PATCH bpf-next] libbpf: Make btf_name_info.needs_size unsigned

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

 



On 27/06/2024 10:09, Ilya Leoshkevich wrote:
> Clang build of libbpf fails with:
> 
> tools/lib/bpf/btf_relocate.c:206:23: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
>   206 |                 info[id].needs_size = true;
>       |                                     ^ ~~~~
> 
> Resolve the issue by making needs_size unsigned.
> 
> Fixes: 19e00c897d50 ("libbpf: Split BTF relocation")
> Signed-off-by: Ilya Leoshkevich <iii@xxxxxxxxxxxxx>

Thanks for the fix! This one should already be resolved in bpf-next via

0f31c2c61f69 ("libbpf: Fix clang compilation error in btf_relocate.c")

> ---
>  tools/lib/bpf/btf_relocate.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/lib/bpf/btf_relocate.c b/tools/lib/bpf/btf_relocate.c
> index 2281dbbafa11..d2551d7f33c8 100644
> --- a/tools/lib/bpf/btf_relocate.c
> +++ b/tools/lib/bpf/btf_relocate.c
> @@ -58,7 +58,7 @@ struct btf_relocate {
>  struct btf_name_info {
>  	const char *name;
>  	/* set when search requires a size match */
> -	int needs_size:1,
> +	unsigned needs_size:1,
>  	    size:31;
>  	__u32 id;
>  };




[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