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

regression from 0.30: "..." disappear from function pointer #1216

Closed
Dushistov opened this issue Jan 5, 2018 · 3 comments
Closed

regression from 0.30: "..." disappear from function pointer #1216

Dushistov opened this issue Jan 5, 2018 · 3 comments

Comments

@Dushistov
Copy link
Contributor

Input C/C++ Header

void f(int a, ...);
struct Foo {
        void (*f)(void *p, void *obj, int a, ...);
};

Bindgen Invocation

$ bindgen test.h

Actual Results

extern "C" {
    pub fn f(a: ::std::os::raw::c_int, ...);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct Foo {
    pub f: ::std::option::Option<
        unsafe extern "C" fn(
            p: *mut ::std::os::raw::c_void,
            obj: *mut ::std::os::raw::c_void,
            a: ::std::os::raw::c_int,
        ),
    >,
}

Expected Results

extern "C" {
    pub fn f(a: ::std::os::raw::c_int, ...);
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct Foo {
    pub f: ::std::option::Option<unsafe extern "C" fn(p:
                                                          *mut ::std::os::raw::c_void,
                                                      obj:
                                                          *mut ::std::os::raw::c_void,
                                                      a:
                                                          ::std::os::raw::c_int, ...)>,
}

as can you see variant generated by version <= 0.30 contains "..." at the end of Foo::f,
while bindgen > 0.30 missed "..." in the function pointer definition.

@emilio
Copy link
Contributor

emilio commented Jan 6, 2018

Culprit seems to be 61743aa, which is not a small commit... cc @fitzgen

@emilio
Copy link
Contributor

emilio commented Jan 6, 2018

I've got a fix.

@emilio
Copy link
Contributor

emilio commented Jan 6, 2018

Fix at #1217

bors-servo pushed a commit that referenced this issue Jan 6, 2018
codegen: Be consistent about variadic signatures.

Fixes #1216.
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

2 participants