-
Notifications
You must be signed in to change notification settings - Fork 694
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
Rustified enums getting both #[repr(u32)] and #[repr(C)] #1224
Comments
The same problem can be seen in the generated code in issue #1198. But that issue is about something else, so I felt it was worth reporting on this alone. |
Stumbled on the same bug just now. |
Hmm, this is clearly a regression... Shouldn't be hard to fix. |
Oh, I lie, this was added intentionally in 43c43ba... Which version of rustc are you using? |
@emilio EDIT: Latest nightly gives the same warning, but stable does not give any warning when compiling with two representation hints. |
Ok, asked in TL;DR: the extra repr(C) is only needed for enums with fields, not for plain enums that bindgen generates. |
Will send a patch with a fix. |
That's only undefined for enums with fields. Fixes rust-lang#1224 See also: https://botbot.me/mozilla/rustc/2018-01-19/?msg=95934948&page=2
codegen: Don't generate repr(C) for enums. That's only undefined for enums with fields. Fixes #1224 See also: https://botbot.me/mozilla/rustc/2018-01-19/?msg=95934948&page=2
That's only undefined for enums with fields. Fixes rust-lang#1224 See also: https://botbot.me/mozilla/rustc/2018-01-19/?msg=95934948&page=2
codegen: Don't generate repr(C) for enums. That's only undefined for enums with fields. Fixes #1224 See also: https://botbot.me/mozilla/rustc/2018-01-19/?msg=95934948&page=2
Input C header
Bindgen Invocation
Actual Results
With
bindgen 0.32.1
I get:rustc warning when compiling:
Expected Results
To only have one
#[repr(...)]
:The text was updated successfully, but these errors were encountered: