-
Notifications
You must be signed in to change notification settings - Fork 723
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
Wrong layout for packed struct with bitfields #981
Comments
Thanks for the bug report :) |
The argument shadowing is a dupe of #840 But I am going to test the layout issue without the shadowing and see if that is its own bug. |
Here is a modified version of the test case with just the packed + bitfield layout issues: struct __attribute__((packed)) PackedWithBitfields {
unsigned six_bits : 6;
unsigned thirty_two_bits : 32;
}; Which results in this:
|
Hi Nick, here is a simpler case. The two cases reported here are reduced from the same testcase. $ ./b.sh bindgen abc.h
$ cat abc.h
|
I think this is actually a slightly different bug: we aren't taking into account bitfield allocation units' widths when determining if we can I'll file a new issue. |
Filed #982 |
A couple more instances of this bug: struct WithBitfieldAndAttrPacked {
unsigned : 7;
unsigned a;
} __attribute__((packed));
#pragma pack(1)
struct WithBitfieldAndPacked {
unsigned : 7;
unsigned a;
}; |
Is this still a problem? I'm running into this error using bindgen 0.30.0 with code
|
I am using this script https://gist.github.com/fitzgen/187381e358f60efa8194d0b276b4d11a.
The hashtag for my bindgen version is 4dd4ac7 .
$ ./b.sh bindgen abc.h
$ cat abc.h
The text was updated successfully, but these errors were encountered: