cil-project / cil

C Intermediate Language
Other
348 stars 86 forks source link

Parsing pragmas in CIL #22

Open zumpchke opened 9 years ago

zumpchke commented 9 years ago

I'm trying to pass down some information from a C source file prior to the file being preprocessed. I decide to use the #pragma syntax to achieve this

(Unfortunately), there are some constructs which result in a ParseError. For example:

#pragma __test__("blah")
void my_fn_defn(void *ptr)
#pragma __test__("foo")
{
...
}

Why does this fail, isn't the pragma still at the "toplevel"? I.e The scope of the function hasn't started yet.