-
Notifications
You must be signed in to change notification settings - Fork 68
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
no method value(::CLPackedAttr)
#224
Comments
Since
|
It looks like libclang provides a way to get the fieldoffset info: Lines 904 to 910 in 289bdd5
maybe we could write a macro/function for constructing structs with dummy padding fields automatically inserted? |
I think a packed enum means that it will be only using Int8 in this case? But I am not a 100% on all the C-semantics. In any case Clang.jl should at least ignore it and print a warning. |
Yes, it has to respect the platform alignment rules (e.g. base reflects a bunch of structs from libraries like libuv that would be very broken otherwise).
The only issue there is that the output will probably be wrong on systems where ptrdiff_t is 32-bit (ARM and x86 Windows; not sure if Julia still even supports the latter). I don't know a good solution to that... Ideally this would be pushed down in to the compiler, but it is enough of an edge-case that everybody has obviously gotten by without it for this long, using https://github.com/Keno/StructIO.jl and StrPack, etc.
IIUC yes, from a quick read of GCC's page about it -- should pack to the smallest type which can represent the range. That said, this is about the point where I might start thinking about C helper shims to get the as-compiled size, especially if you are going to be using UCX on any "interesting" hardware. |
It seems to be just:
The text was updated successfully, but these errors were encountered: