-
Notifications
You must be signed in to change notification settings - Fork 37
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
typedef function prototypes don't retain arguments #262
Comments
Actually, thinking more carefully about the title, I haven't proved that the typedef does not retain the function arguments, but I THINK that is the case given that |
The AST looks different for Based on the title of this issue, I think you're misunderstanding the code. typedef char *(*kgets_func)(char *, int, void *);
int f(char *s, kgets_func fgets, void *fp); Which is properly translated to: extern (C):
alias kgets_func = char* function (char*, int, void*);
int f (char* s, kgets_func fgets, void* fp); |
The example you have provided is still a bug. But it might not be the code you want to write. |
|
I see now it is a function prototype. C programmer habit of attaching pointer operator to the RHS drives me crazy.
Either way, appreciate insight into the bug as it requires manual intervention after dstep |
Results in:
Note
f
was not translated correctly; its second parameter takes typechar* function()
but should takechar* function(char* int, void *)
or more simplykgets_func
via the alias.The text was updated successfully, but these errors were encountered: