-
Notifications
You must be signed in to change notification settings - Fork 772
Closed
Description
Input C/C++ Header
struct foo {
char member;
};
Bindgen Invokation
bindgen foo.h
Actual Results
/* automatically generated by rust-bindgen */
#[repr(C)]
#[derive(Debug, Copy)]
pub struct foo {
pub member: ::std::os::raw::c_schar,
}
#[test]
fn bindgen_test_layout_foo() {
assert_eq!(::std::mem::size_of::<foo>() , 1usize , concat ! (
"Size of: " , stringify ! ( foo ) ));
assert_eq! (::std::mem::align_of::<foo>() , 1usize , concat ! (
"Alignment of " , stringify ! ( foo ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const foo ) ) . member as * const _ as usize }
, 0usize , concat ! (
"Alignment of field: " , stringify ! ( foo ) , "::" ,
stringify ! ( member ) ));
}
impl Clone for foo {
fn clone(&self) -> Self { *self }
}Expected Results
The field should be c_char, not c_schar. char is not defined as always signed in the C standard. It can be unsigned.
Metadata
Metadata
Assignees
Labels
No labels