Skip to content

bindgen_test_layout_max_align_t ... FAILED #577

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

Closed
Dushistov opened this issue Mar 12, 2017 · 3 comments
Closed

bindgen_test_layout_max_align_t ... FAILED #577

Dushistov opened this issue Mar 12, 2017 · 3 comments

Comments

@Dushistov
Copy link
Contributor

Input C/C++ Header

// Define 'max_align_t' to match the GCC definition.
typedef struct {
  long long __clang_max_align_nonce1
      __attribute__((__aligned__(__alignof__(long long))));
  long double __clang_max_align_nonce2
      __attribute__((__aligned__(__alignof__(long double))));
} max_align_t;

I take it from llvm/clang header.

Bindgen Invokation

$ bindgen --no-unstable-rust test.h 

Actual Results

#[repr(C)]
#[derive(Debug, Copy)]
pub struct max_align_t {
    pub __clang_max_align_nonce1: ::std::os::raw::c_longlong,
    pub __bindgen_padding_0: u64,
    pub __clang_max_align_nonce2: f64,
}
test gen_c::bindgen_test_layout_max_align_t ... FAILED

failures:

---- gen_c::bindgen_test_layout_max_align_t stdout ----
        thread 'gen_c::bindgen_test_layout_max_align_t' panicked at 'assertion failed: `(left == right)` (left: `24`, right: `32`): Size of: max_align_t', gen_c.rs:12
note: Run with `RUST_BACKTRACE=1` for a backtrace.


failures:
    gen_c::bindgen_test_layout_max_align_t

test result: FAILED. 1 passed; 1 failed; 0 ignored; 0 measured

Expected Results

All generated tests should be "green".

$ bindgen --version
bindgen 0.22.1

I also tried 1320efe, but it also generate failed test.

@emilio
Copy link
Contributor

emilio commented Mar 12, 2017

Right, this is a dupe of #550. See there for workarounds. Thanks for reporting!

@emilio emilio closed this as completed Mar 12, 2017
@philn
Copy link

philn commented Feb 21, 2019

The link is 404 though. I'm also getting this issue :/

@traviscross
Copy link

The correct link is now: #550

The underlying issue was apparently fixed. However, the fix relies on the final build being done with a recent version of rustc, so we need to promise bindgen that we'll use such a version. E.g.:

Builder::default()
  .rust_target(bindgen::RustTarget::Stable_1_28)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants