-
Notifications
You must be signed in to change notification settings - Fork 49
Wrong decl_type for function pointers ? #61
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
Comments
Thanks for reporting. I will be on holidays for 3 weeks, so I will only able to have a look at this end of August. I will probably not have internet so I won't be able to respond to any questions/mails. |
No problem, I have a workaround :) |
Hi I had a look at this problem. I do not think that it is a bug at first. If you print I wrote an example to explain how these nested types work: And a more specific example for function pointers, which is the case you are treating here: Hope that helps. Please close this bug if this works for you. |
when I ask for "decl.arguments[0].decl_type", do you agree it should return |
This does not change the type of the declaration, just the value of the decl_string attribute.
Yes I guess the * is not wanted in that case. I am not using C++ often, so function pointer / pointer things are sometimes a little bit hairy for me. I made a small change to the develop branch. I special-cased the function pointer decl_type creation, and the * is now gone. The type is still Please tell me if that change is OK for you. I will apply that specific patch to the next 1.8.1 release then. |
I'm closing this bug, as I consider the problem as fixed for now. Do not hesitate to open a new one if this does not work for you. |
The commit is in develop branch: is that the branch that will become pygccxml1.9 ? or should I cherry pick the commit ? |
At the moment yes, but 1.9.0 will probably not go out before next year. It took at least 1 year between 1.7.0 and 1.8.0. I will just make a 1.8.1 release with that specific fix, probably next week. I am currently looking at the struct thing. |
This does not change the type of the declaration, just the value of the decl_string attribute.
When the argument is a function pointer, there seems to be a few problems:
For instance for the function
int atexit(void (*function)(void));
, the pygccxml codedecl.arguments[0].decl_type
returns:void (*)( ) *
which has 1 more asterisk then necessary ?Nb: I made a mistake and ended up posting it first here
CastXML/CastXML#67
The text was updated successfully, but these errors were encountered: