rust-bindgen icon indicating copy to clipboard operation
rust-bindgen copied to clipboard

Incorrect bitstream length

Open wdouglass opened this issue 5 months ago • 2 comments

See the attached rust crate, which generates a binding for a simple structure in a c99 h file.

When the cargo build command is run, build.rs generates a binding file, which is included in lib.rs

the binding file creates struct resource which has two bitfields. the second is

    pub _bitfield_2: __BindgenBitfieldUnit<[u8; 7usize]>,

i believe that bitfield should be 6 bytes wide (containing struct members r, s, t, u, v, w, x, y, and z, and totaling 48 bits). that bitfield is 7 bytes wide which causes the build to fail. is this a bug in bindgen or have i missed something?

Thank you for your attention.

bindgenbug.zip

wdouglass avatar Jun 24 '25 20:06 wdouglass

#3215
this PR fixed mostlies bitfield bug and included this, but code reviewer busy

qinghon avatar Jun 25 '25 07:06 qinghon

Thank you! i'll try with that patch

wdouglass avatar Jun 25 '25 11:06 wdouglass