-
Notifications
You must be signed in to change notification settings - Fork 1
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
Anonymous structure error in function's parameters #3
Comments
I see the typedef in the metadata. the query interfaces needs usability testing and refinement. this is a point where one was up to. if you see the code example in the response to #1, you'll see the use of
It might be possible to formulate the references to the types in less ambiguous ways than C. i.e. Rust-style or Go-style where types are left-to-right instead of a complex mix of left-to-right and right-to-left due to C pointer specification mess. try
|
Maybe have a look to #5, I've tried to solve this when it isn't ambiguous. It gives something like this:
|
I think I see what you mean from reading the output. typedefs are desugared so the function links to the anonymous structure decl but do you want a link to the typedef instead? I had wanted that also but I don't know the implications of a particular approach yet as not all clang AST methods are robust. the test cases have not been "buttoned down" yet so to speak i.e. we presently use visual inspection of the resulting graphs and intend to create exemplars after inspection to tie the behaviour to the expected output. so the test cases we have at present are inputs that we need to handle but there is no reporting of errors unless. locally I save the output of run_tests.py and diff it. I will take a look at the pull request... |
Take this code for example:
Right now, crefl can't reproduce the signature for the
foo
function because thebar
parameter is of type "qualifier(struct)" instead of "qualifier(typedef(struct))". Since the structure is anonymous, the only way to call this function is to use the typedef but this is not what crefl has stored in its database.So, is there a way to find out the typedef's
decl_ref
for an anonymous structure'sdecl_ref
?Or better, would it be possible for crefl to store the parameter as a typedef instead of a struct at first ?
The text was updated successfully, but these errors were encountered: