apple: change BPF_ALIGNMENT to usize - #5348
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
|
I think stable nomination is appropriate here since this is a fix for an incorrect type definition rather than an intentional API change. |
@rustbot label +stable-nominated |
5d73fad to
8895eea
Compare
This comment was marked as outdated.
This comment was marked as outdated.
8895eea to
dbf1960
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
There was a problem hiding this comment.
LGTM. I don't love backporting here - I'd call the fact that they use sizeof in the source more of an implementation detail than confirmation that the type should be size_t. But this will harmonize with FreeBSD and I doubt there are many users not already casting to usize to do something with alignment, so let's do it.
Cc @xingxue-ibm, AIX may want to change BPF_ALIGNMENT to size_t as well.
$ bindgen $(xcrun --show-sdk-path)/usr/include/net/bpf.h --clang-macro-fallback | grep BPF_ALIGNMENT
pub const BPF_ALIGNMENT: u32 = 4; |
As far as I understand, |
|
(backport <rust-lang#5348>) (cherry picked from commit 1925488)
(backport <rust-lang#5348>) (cherry picked from commit 1925488)
(backport <rust-lang#5348>) (cherry picked from commit 1925488)
(backport <rust-lang#5348>) (cherry picked from commit 1925488)
Description
The header defines
BPF_ALIGNMENTassizeof(int32_t), which isusize, notc_int.Breaking change for anyone matching on the current type, so no stable-nomination.
Sources
Apple
BPF_ALIGNMENT(net/bpf.h):Checklist
libc-test/semverhave been updated (no new symbols)*LASTor*MAXare includedcd libc-test && cargo test --target mytarget)