-
Notifications
You must be signed in to change notification settings - Fork 6
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
Fix places where struct attributes should be permitted #193
Conversation
…he C11 standard. This hasn't been a problem historically, because if we have code like: if(foo) { do { ... } while(0); } Then it gets parsed as (not the real AST): if($Expr{ foo }, seqStmt( doWhile(...), -- do { ... } while(0) emptyStmt(), -- ; )) However, this caused a parse failure when parsing the DPDK header, with code like: if(foo) do { ... } while(0); else f(); In this code, we have two statements after the if, so the else is "floating."
This is implemented synonym for C11 _Thread_local. https://stackoverflow.com/a/40635676 suggests that they're the same? This probably ought to be verified before merging this, but this is a hotfix.
@RandomActsOfGrammar can you check if this + the changes on the dpdk-bugs branch are enough to build your thing? |
This parses the minimal example you sent me, at least. Actually we should probably add that to the ableC test cases too. |
It appears not, but it is also possible I didn't figure out all the build steps I needed to do. I built AbleC with the changes, then I built Silver-AbleC which my extension uses (not sure if this is necessary), then I built my extension. I then tried to build my example, and I got an error from the DPDK code. The error:
The immediate context in that file:
Line 55 is the first |
can you do the |
I ran |
Try deleting the CPP location tags? Otherwise it's still using the locations from the original file. |
yeah that was the |
Or |
After running Lucas's command, I'm getting the same error on the same line, but now with a location in the |
what's at that location now |
|
I don't remember this line from Monday. |
Huh, so it wasn't a weird location issue. We should be ignoring all unrecognized global pragmas, though. Or is this inside of a function? Could you send the exact parse error? |
Parse error:
It is not inside a function. I don't think it is inside anything. I don't know how to attach the whole file here. |
Okay, I guess we weren't handling all pragmas by default - try it again with my fix/struct-attributes branch |
I'm still getting an error in the same place:
|
Oops, copy-pasted a regex without looking too closely - try it again. |
The good news is you fixed that error. The bad news is there is another one:
The code for it:
Line 43 is the second definition. Column 23 is the |
I seem to have sorted out the concrete syntax grammar (I think it's as simple as that attributes can appear anywhere that a list of qualifiers can) but ableC's abstract syntax doesn't currently support attributes in every place that qualifiers can appear. This is a bit annoying, but should be possible to address. |
I'm gonna un-mark myself as reviewer; I've been getting thrice daily slack pings abt this for a few months :P |
wrt last two commits, how bad was it? |
SIlver needed 7G of heap to run the flow analysis on just ableC by itself, the extensions would all presumably need even more. Only the first commit was actually needed though, the second was me trying to diagnose the test failures. |
2b3ebe5
to
d3a3664
Compare
…lling in all the xmm intrinsic crud." This reverts commit 3a17801.
1137c61
to
96d4d89
Compare
I reverted the second commit. It seems the jenkins failures were because of @remexre's commit 3a17801 switching to use clang for C preprocessing, for some reason? If this build passes, then I think this is good to review/merge. Probably good to get this in before we create a bunch of merge conflicts by removing autocopy. |
It seems the best way of resolving the ambiguity is to use precedence - we want to prefer the shift (attaching attributes to the struct declaration specifier) over the reduce (putting attributes following a struct declaration specifier as their own declaration specifier.)