Skip to content

Failed to get propper argument_types property on function declaration #26

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
bloff opened this issue Oct 27, 2014 · 1 comment
Closed

Comments

@bloff
Copy link
Contributor

bloff commented Oct 27, 2014

The following declaration appears in the preprocessed stdio.h from gcc's standard C library:
extern int fscanf (FILE *__restrict __stream, const char *__restrict __format, ...);

I made a python plugin for gcc with callbacks on PLUGIN_FINISH_DECL, hoping to translate such declarations into equivalent declarations in a different programming language.

However:
When parsing this declaration, I get a gcc.FunctionDecl object, and in this object there is a type attribute of type gcc.FunctionType, and the problem is: the argument_types attribute of this gcc.FunctionType is a list of length 1!

I expected length 3, with the last type being a va_args kind of thing...

I will try to fix it myself, but meanwhile I leave here an issue report.

@tromey
Copy link
Contributor

tromey commented Nov 19, 2015

tromey added a commit to tromey/gcc-python-plugin that referenced this issue Nov 20, 2015
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

No branches or pull requests

2 participants