We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
See original issue #1034
Generated by C-Smith and reduced by creduce:
creduce
union U4 { unsigned : 1 };
$ bindgen input.h --with-derive-partialeq --with-derive-eq
running 1 test test bindgen_test_layout_U4 ... FAILED failures: ---- bindgen_test_layout_U4 stdout ---- thread 'bindgen_test_layout_U4' panicked at 'assertion failed: `(left == right)` left: `2`, right: `1`: Size of: U4', /var/folders/cd/c9707gm91qj22fkb99clygfm0000gn/T/bindings.rs.XXXXXX.E24MhMan:58:4 failures: bindgen_test_layout_U4 test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
No layout test failures.
The text was updated successfully, but these errors were encountered:
Seems like we have a different problem in the size case.
Let's consider this header:
in generated bindings assert test is failing
assert_eq!( ::std::mem::size_of::<U4>(), 1usize, concat!("Size of: ", stringify!(U4)) );
and it makes sense if we look at U4 definition:
U4
#[repr(C)] #[derive(Copy)] pub struct U4 { pub _bitfield_1: u8, pub bindgen_union_field: u8, }
there are 2 disjoint fields, and this is clearly wrong.
I suppose in this case we shouldn't generate _bitfield_1 but should refer bindgen_union_field in bitfield's accessors.
_bitfield_1
bindgen_union_field
Sorry, something went wrong.
This is a dupe of #744, I believe.
Agree, closing.
No branches or pull requests
See original issue #1034
Input C/C++ Header
Generated by C-Smith and reduced by
creduce
:Bindgen Invocation
Actual Results
Expected Results
No layout test failures.
The text was updated successfully, but these errors were encountered: