-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Incorrect alignment of types on x86_64-apple-darwin #914
Comments
What do the C structs look like for these on macos? Do they apply some packing to lower alignment on 64bit? |
You can search for the struct names in the MacOSX10.13.sdk specified there, the struct themselves have no special annotations, but the header files do have a |
Ah thanks, my google-fu was failing me. |
Yeah MacOSX headers are not really googleable. That github repo with all headers for all MacOSX versions is just golden. |
I was thinking about this issue and your example in rust-lang/rust#48159 you could put a |
Yes, an "easier" alternative is to just use an opaque type (e.g. an array of bytes) and the appropriate repr(align), and then just have setters/getters for the fields. I think we'll just wait till |
ref for |
packed is now used when building from within std - i'll open another issue to track the packed(N) stabilization |
The types:
kevent
shmid_ds
should have 4-byte alignment, but on 64-bit macosx they have 8-byte alignment.
This means that:
I tried to use
#[repr(align(4))]
on these to enforce the alignment, but this did not change anything.See https://github.com/rust-lang/libc/pull/912/files#diff-747c41e91bd79d9208c2953b72047176R418
The text was updated successfully, but these errors were encountered: