[cfe-dev] decl/expr ambiguity

Argiris Kirtzidis akyrtzi at gmail.com
Sun Aug 24 19:14:35 PDT 2008


Argiris Kirtzidis wrote:
> PS: Here's a weird test I did. I used the preparser to see how many 
> "ambiguous" declarations (of T(...) style) there are in actual C code. 
> I used a few of GCC files:
> gcc.c:  declarations in functions: 432       ambiguous: 0
> expr.c  declarations in functions: 730      ambiguous: 0
> combine.c declarations in functions: 564   ambiguous: 0
>
> I think this suggests that it's a really uncommon case.

Just to clarify, IMO this indicates that if we are to enter ambiguity 
resolution, doing a "tentative parse decl" approach does not offer much 
of a performance benefit because, in the majority of cases, it will be 
an expression statement, so backtracking will happen anyway.


-Argiris



More information about the cfe-dev mailing list