Skip to content

libbpf: fix warnings "'pad_type' 'pad_bits' 'new_off' may be used uninitialized" #5415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

kernel-patches-daemon-bpf[bot]
Copy link

Pull request for series with
subject: libbpf: fix warnings "'pad_type' 'pad_bits' 'new_off' may be used uninitialized"
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=770025

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 63e2da3
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=770025
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 10d78a6
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=770025
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: f7e6bd3
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=770025
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: a76584f
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=770025
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: d1a0235
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=770025
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: ee932bf
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=770025
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: eb03993
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=770025
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: fb213ec
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=770025
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 74bdfab
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=770025
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: e99688e
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=770025
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 81584c2
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=770025
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 1110865
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=770025
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: d3c4db8
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=770025
version: 1

…nitialized"

When turn on the yocto DEBUG_BUILD flag, the build options for gcc would enable maybe-uninitialized,
and following warnings would be reported as below:

| btf_dump.c: In function 'btf_dump_emit_bit_padding':
| btf_dump.c:916:4: error: 'pad_type' may be used uninitialized in this function [-Werror=maybe-uninitialized]
|   916 |    btf_dump_printf(d, "\n%s%s: %d;", pfx(lvl), pad_type,
|       |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|   917 |      in_bitfield ? new_off - cur_off : 0);
|       |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| btf_dump.c:929:6: error: 'pad_bits' may be used uninitialized in this function [-Werror=maybe-uninitialized]
|   929 |   if (bits == pad_bits) {
|       |      ^
| btf_dump.c:913:28: error: 'new_off' may be used uninitialized in this function [-Werror=maybe-uninitialized]
|   913 |       (new_off == next_off && roundup(cur_off, next_align * 8) != new_off) ||
|       |       ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|   HOSTLD  scripts/mod/modpost

Signed-off-by: Xiangyu Chen <[email protected]>
@kernel-patches-daemon-bpf
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=770025 expired. Closing PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant