Skip to content

wrap-static-fns emits old-style C decalarations #2442

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
alex opened this issue Mar 15, 2023 · 3 comments · Fixed by #2443
Closed

wrap-static-fns emits old-style C decalarations #2442

alex opened this issue Mar 15, 2023 · 3 comments · Fixed by #2443

Comments

@alex
Copy link
Member

alex commented Mar 15, 2023

Input C/C++ Header

static inline int *f(void) { return (int *)0; }

Bindgen Invocation

$ bindgen input.h --experimental --wrap-static-fns --wrap-static-fns-path="wrapper.c"

Actual Results

wrapper.c:

int * f__extern(void) asm("f__extern");
int * f__extern() { return f(); }

Expected Results

wrapper.c:

int * f__extern(void) asm("f__extern");
int * f__extern(void) { return f(); }
@pvdrz
Copy link
Contributor

pvdrz commented Mar 15, 2023

👋 I see no difference between the two results 😅

Edit: OHHHH it's the void

@alex
Copy link
Member Author

alex commented Mar 15, 2023

Yeah, sorry, I should have been more precise. Produces this warning:

[...]/rust/wrapper.c:1468:38: error: old-style function definition [-Werror=old-style-definition]
 1468 | struct stack_st_ACCESS_DESCRIPTION * sk_ACCESS_DESCRIPTION_new_null__extern() { return sk_ACCESS_DESCRIPTION_new_null(); }
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@alex
Copy link
Member Author

alex commented Mar 15, 2023

Thanks for the super quick fix!

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

Successfully merging a pull request may close this issue.

2 participants