C syntax problem in gcc

Mo McKinlay mmckinlay@labs.interopen.org
Sat Apr 8 04:36:00 GMT 2000


# I was writing a C parser and wondered how this case can be parsed.
# I just checked a few compilers for reference and only gcc failed to
# accept it.  I also checked the ISO standard (actually the C9X draft
# and an old book on Ansi C, the grammar hasn't changed in that respect).

Ah, I see :-)
 
# BTW, there's no ambiguity in the example.  If it were ambiguous,
# gcc could have understood it in an unexpected way, but in fact gcc
# didn't understand it at all.  The gcc grammar probably expects an
# ambiguity and takes the choice that doesn't lead to a successful parse.

Fair enough - like I said, I wasn't sure. :-)

-- 
Mo McKinlay             Chief Software Architect         inter/open Labs
mmckinlay (at) labs.interopen.org               http://www.interopen.org




More information about the Gcc-bugs mailing list