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 gets bindings for function pointer as return-type wrong. #1500

Closed
bobbobbio opened this issue Jan 24, 2019 · 1 comment
Closed

Bindgen gets bindings for function pointer as return-type wrong. #1500

bobbobbio opened this issue Jan 24, 2019 · 1 comment
Labels

Comments

@bobbobbio
Copy link

Input C Header

int (^my_function(void))(int, int);

Bindgen Invocation

$ bindgen foo.h

Actual Results

/* automatically generated by rust-bindgen */

extern "C" {
    pub fn my_function() -> ::std::option::Option<unsafe extern "C" fn() -> ::std::os::raw::c_int>;
}

Expected Results

Bindgen gets the arguments to the function pointer incorrect. I expect it to get it correct. This problems also extends to clang-block, perhaps unsurprisingly. Weirdly, if I put the return-type behind a typedef, the problem seems to go away.

flowbish pushed a commit to flowbish/rust-bindgen that referenced this issue Jan 31, 2019
This fixes the issue seen in rust-lang#1500 where function
pointers as a return type have their parameters incorrectly generated.
@emilio emilio added the bug label Jan 31, 2019
flowbish added a commit to flowbish/rust-bindgen that referenced this issue Feb 1, 2019
…signatures.

This fixes the issue seen in rust-lang#1500 where function
pointers as a return type have their parameters incorrectly generated.

This also fixes a broken test case, objc_property_fnptr, as its types
are now generated correctly.
flowbish added a commit to flowbish/rust-bindgen that referenced this issue Feb 3, 2019
…signatures.

This fixes the issue seen in rust-lang#1500 where function
pointers as a return type have their parameters incorrectly generated.

This also fixes a broken test case, objc_property_fnptr, as its types
are now generated correctly.
emilio pushed a commit to flowbish/rust-bindgen that referenced this issue Feb 3, 2019
…signatures.

This fixes the issue seen in rust-lang#1500 where function
pointers as a return type have their parameters incorrectly generated.

This also fixes a broken test case, objc_property_fnptr, as its types
are now generated correctly.
@emilio
Copy link
Contributor

emilio commented Feb 3, 2019

Fixed by #1508. Thanks @flowbish!

@emilio emilio closed this as completed Feb 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants