"and" and "or" keywords

y2bismil@engmail.uwaterloo.ca y2bismil@engmail.uwaterloo.ca
Fri Oct 3 16:45:00 GMT 2003



Hi all,

I'm porting some code from Watcom compiler to GCC.  I'm getting this error which
I think is a mistaken use of c++ keywords.

This is the error message:
***************************************************
hdr/myclass.h:53: declaration does not declare anything
hdr/myclass.h:53: parse error before `&&' token
hdr/myclass.h:54: declaration does not declare anything
hdr/myclass.h:107: declaration does not declare anything
hdr/myclass.h:107: parse error before `||' token
hdr/myclass.h:108: declaration does not declare anything
***************************************************

These are the declaration
**************************************
class MY_CLASS {
..
53:  void and(unsigned int number) ;
54:  void and(const MY_CLASS& srcObj) ;
107: void or(unsigned int number) ;
108: void or(const BIG_INT& srcObj) ;
..
};
**************************************
I suspect GCC has "and" and "or" reserved as keywords or built in macros,
whereas watcom did not.  Is this correct?   

If it is, is there a way to turn off these keywords/macros in GCC.   Perhaps by
a commandline option (-ansi) or something.  I'm supposed to make as few changes
as possible to the actual source, which is why a compile option is my first choice.

Thanks all,

Yamin



----------------------------------------
This mail sent through www.mywaterloo.ca






----------------------------------------
This mail sent through www.mywaterloo.ca



More information about the Gcc-help mailing list