Skip to content
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

Bit-field support #226

Open
yallop opened this issue Nov 19, 2014 · 2 comments
Open

Bit-field support #226

yallop opened this issue Nov 19, 2014 · 2 comments

Comments

@yallop
Copy link
Owner

yallop commented Nov 19, 2014

Struct stubs should support bit-fields. Bit-fields can share the field interface, but shouldn't support the @. or |-> operators which take the address of a field.

@XVilka
Copy link

XVilka commented Nov 21, 2019

Any updates on this one? I opened an issue in ocaml-cstruct, and sent a PR, but it seems too complex to be accepted in the cstruct.

@yallop
Copy link
Owner Author

yallop commented Nov 22, 2019

There hasn't been any concrete progress, but I think it's become clearer how to approach this since the issue was opened.

The challenging aspect of supporting bitfields is that the allocation order is implementation-defined, so accessing bit-fields typically needs help from the compiler. This is fairly straightforward to do with stub generation, but would be a lot more work to do using the dynamic interface. There's a little design work to do first in any case, but I think that focusing only on stub generation is likely to work out better than attempting something more dynamic or more general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants