Invalid c struct bitfield generation in some cases #3104
Unanswered
Strackeror
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So, i'm trying to run bindgen from a pokemon decomp project, and having issues with some structs not passing the sanity checks.
I've pinpointed it to an alignment issue on some structs with bitfields, here's an example on godbolt, and the generated bindings file (run with the command
bindgen berry.c -- --target=arm-none-eabi -mthumb -march=armv4t -mabi=apcs-gnu
)For some reason, the
size
field is aligned to the start of the next byte, set to read from bit 16, when it should read from bit 14. Is this a bug in bindgen, or am I missing something when generating the bindings ? Any idea for a workaround ?Beta Was this translation helpful? Give feedback.
All reactions