-
Notifications
You must be signed in to change notification settings - Fork 106
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
Unalign
ABI promises are wrong
#164
Comments
Specifically, the memory layout will still be the same as that of the wrapped type, but the function calling convention can differ. |
This seems like it should also affect any x86-64 Sys-V platform. When determining the class of structures,
|
joshlf
added a commit
that referenced
this issue
Apr 26, 2023
Good catch, thanks @Nilstrieb! Uploaded a fix here. |
joshlf
added a commit
that referenced
this issue
Apr 26, 2023
joshlf
added a commit
that referenced
this issue
Apr 26, 2023
joshlf
added a commit
that referenced
this issue
Aug 3, 2023
joshlf
added a commit
that referenced
this issue
Aug 3, 2023
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://docs.rs/zerocopy/latest/zerocopy/struct.Unalign.html states
This is wrong, as the type is
#[repr(C, packed)]
and notrepr(transparent)
.The Rust reference about
repr(transparent)
:Here's an example of such an ABI mismatch in practice: https://godbolt.org/z/bhP71dnh4
The docs should be relaxed to not promise full ABI compatibility, but only promise what
repr(C)
promises (which is probably strong enough for most use cases).The text was updated successfully, but these errors were encountered: