bpf: Avoid thousands of -Wflex-array-members-not-at-end warnings#11274
Open
kernel-patches-daemon-bpf[bot] wants to merge 1 commit intobpf-next_basefrom
Open
bpf: Avoid thousands of -Wflex-array-members-not-at-end warnings#11274kernel-patches-daemon-bpf[bot] wants to merge 1 commit intobpf-next_basefrom
kernel-patches-daemon-bpf[bot] wants to merge 1 commit intobpf-next_basefrom
Conversation
Author
|
Upstream branch: 05c9b2e |
c7dcbca to
69a44ca
Compare
Author
|
Upstream branch: 4faa189 |
3ace7fa to
899b409
Compare
69a44ca to
f264dc7
Compare
Author
|
Upstream branch: 748f9c6 |
899b409 to
d86b517
Compare
f264dc7 to
59120bd
Compare
-Wflex-array-member-not-at-end was introduced in GCC-14, and we are getting ready to enable it, globally. struct bpf_prog_array is a flexible structure, this is a structure that contains a flexible-array member (struct bpf_prog_array_item items[];). We create the new struct bpf_prog_array_hdr type, and use it to replace the object type causing trouble in struct bpf_empty_prog_array, namely struct bpf_prog_array hdr; Also, once -fms-extensions is enabled, we can use transparent struct members in struct bpf_prog_array. Notice that the newly created type does not contain the flex-array member `items`, which is the object causing the -Wfamnae warnings in struct bpf_empty_prog_array. With these changes, fix the following warnings: 7659 ./include/linux/bpf.h:2369:31: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Author
|
Upstream branch: 6dd780f |
d86b517 to
3cf742b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request for series with
subject: bpf: Avoid thousands of -Wflex-array-members-not-at-end warnings
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1060844