-
Notifications
You must be signed in to change notification settings - Fork 10
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
POINTER_ALIGNMENT not applied to Rust structs #60
Comments
Doesn't look like there's any metadata for that - not sure what that would be. I'll pass this question on to the win32metadata repo for discussion. |
Related to microsoft/win32metadata#1044 where ClangSharp doesn't scrape @tannergooding any updates on this issue? |
Haven't had a chance to dig into it yet. This is also a particularly troublesome case since its not packing, but rather individual field adjustments which can't be represented by many languages/runtimes and a case where the layout will differ between 32-bit and 64-bit, so its not something that can necessarily be picked up with a single traversal. -- Even with this metadata, I'm not sure Rust has an attribute to do this layout itself. It has |
-- If someone else wants to give it a go, contributions are welcome and the relevant attributes should be available off the AST nodes already. |
I don't think there's any problem with that, so long as the metadata is there. A |
Sure, just it needs to be clarified where it is relevant for ABI purposes/etc.
Similarly, An anonymous struct/union is likewise explicitly a different struct/union, just one where language syntax allows direct access and thus There are even platforms where the signedness of the type is relevant for ABI purposes and thus |
Summary
POINTER_ALIGNMENT is not applied to the rust structs for example.
file:
libs/sys/src/Windows/Wdk/Foundation/mod.rs
This struct has length 24 bytes in rust. But the C version has more padding with the InputBufferLength and IoControlCode
file:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\km\wdm.h
Crate manifest
No response
Crate code
No response
The text was updated successfully, but these errors were encountered: