-
Notifications
You must be signed in to change notification settings - Fork 698
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
on 32-bit platform (e.g. PI) including sys/param.h causes 'shift left with overflow error'. #739
Comments
Can you see, of the files that get recursively included, which one contains structs with bitfields? That is computing a bitfield, that presumably is too wide for us to represent as a simple bitmask op in 32 bits? Perhaps switching the bitfield mask to Thanks for the report! |
Sorry -- i probably should have tried to narrow it down a bit further before submitting. I finally found the offending struct from /usr/include/arm-linux-gnueabihf/sys/ucontext.h on my PI. The problem appears to be Below is a code snippet that will trigger this error in bindgen.
|
Well, that makes sense, thanks a lot for finding that out! |
More minimized, and also reproducible in 64-bit: #define POINTER_WIDTH (sizeof(void*) * 8)
struct Foo {
unsigned long m_bitfield: POINTER_WIDTH;
}; |
Fix at #742. Need to think about what the correct fix is for larger than-word-size bitfields. C++ truncates, but that shouldn't block that fix. |
Input C/C++ Header
Bindgen Invocation
Actual Results
Expected Results
On my 32-bit arm platforms (namely a Raspberry PI, and Beaglebone), I Expect it not to crash when running build program. I found this when working w/ a c-library, and narrowed it down the sys/param.h
There is no crash on 64-bit platforms.
RUST_LOG=bindgen
OutputThe text was updated successfully, but these errors were encountered: