[antlr-interest] C target; C++ compatibility?

Rupert Mazzucco mazzucco at iiasa.ac.at
Mon Sep 10 06:04:15 PDT 2007


antlr3bitset.h declares a function pointer named "or":

  struct ANTLR3_BITSET_struct  *  (*or)	    (struct ANTLR3_BITSET_struct  * bitset1, struct ANTLR3_BITSET_struct * bitset2);

This seems to collide with the C++ keyword of the same name when I include
the *Parser,Lexer.h headers in a C++ program.  Gcc 4.1.2 apparently replaces
it with "||" and reports a corresponding syntax error.  MSVC 2005 doesn't seem
to have a problem with it.  I am not sure which behavior is correct, put wanted
to put it up for consideration.  Where else would one need to rename this
pointer to get it to work with gcc?

Regards
-- 
Rupert Mazzucco         <mazzucco at iiasa.ac.at>
Research Scholar, Evolution and Ecology Program
IIASA - Institute for Applied Systems Analysis
Schlossplatz 1, 2361 Laxenburg, Austria
Phone: +43 2236 807 522   Fax: +43 2236 713 13


More information about the antlr-interest mailing list