-
Notifications
You must be signed in to change notification settings - Fork 68
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
structs created in wrong order #351
Comments
Which version are you using? I can't reproduce the issue with the latest release.
|
Wait, did you run I just noticed that the command above will install an old version(v0.8) of Clang.jl with Julia 1.7. To use the latest Clang.jl, you need to run This is indeed a problem. Maybe we should submit a fix to the "General" registry. |
My c-header file was much more complex then this so this was just a part of the file. I can not send the entire file due to that it contains company information. Sorry! I was running Julia 1.6.1 Manisfest: |
Well, I can't debug this without a minimal working example(MWE). You could either make a simplified version of the header without any company info or debug this on your own. The hint is to check the adj field of the l1_dl_sch_tag node after the resolve dependency pass, like ctx.dag.nodes[ctx.dag.tags["l1_dl_sch_tag"]].adj, adj contains a vector of node indices, you could loop it through and check whether it contains a_t or not. |
I think I figured it out. I had an include that messed thinks up a bit for me. |
@danielbrogren would be great if you could share some details. I'm thinking about writing some FAQs for trouble-shooting so that new users won't hit the same issue when using this package. :) |
Hi. a.h typedef struct foo_tag foo_t; b.h #include a.h typedef struct bar_tag{ typedef struct foo_tag { Since a.h was included in b.h the foo_t was defined before bar_t. In 1.3 I later noticed that we solved it like this Would be good wit a validation of the generated api.jl directly after it is created. |
Yeah. In Julia 1.3(Clang.jl v0.14-), tag dependencies are not correctly handled. That's why I wrote this package in v0.14.
|
In c I have the following structs
typedef struct a_tag {
int xxx;
uint8_t *ppp;
} a_t;
typedef struct l1_dl_sch_tag {
a_t yyy[2];
} l1_dl_sch_t;
When checking the generated.jl, some of my structs are in the correct order but some of them are in the wrong order so that l1_dl_sch_tag is defined before a_tag which leads to error: a_tag not defined.
When changing the name of the l1_dl_sch_tag, then it works fine and they are in the correct order again.
The text was updated successfully, but these errors were encountered: