Skip to content
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

bindgen emitted Rust code that won't compile #951

Closed
helloqirun opened this issue Sep 6, 2017 · 1 comment
Closed

bindgen emitted Rust code that won't compile #951

helloqirun opened this issue Sep 6, 2017 · 1 comment

Comments

@helloqirun
Copy link

I am using this script (https://gist.github.com/fitzgen/187381e358f60efa8194d0b276b4d11a) for testing.
The hashtag for my bindgen version is e841f6f.

$ ./b.sh bindgen abc.h

clang-4.0: warning: treating 'c-header' input as 'c++-header' when in C++ mode, this behavior is deprecated [-Wdeprecated]
error[E0428]: the name `a` is defined multiple times
 --> /tmp/bindings-cwqNMA.rs:4:1
  |
3 | pub const a: ::std::os::raw::c_uint = 0;
  | ---------------------------------------- previous definition of the value `a` here
4 | pub const a: _bindgen_ty_1 = _bindgen_ty_1::a;
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `a` redefined here
  |
  = note: `a` must be defined only once in the value namespace of this module

error: aborting due to previous error

Interesting: bindgen emitted Rust code that won't compile!

$ cat abc.h

enum {
  a =
#define a 0
      4
};
@emilio
Copy link
Contributor

emilio commented Sep 6, 2017

Nice one! This is a basically a duplicate of #687, so closing in favour of that one, thanks!

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

No branches or pull requests

3 participants