This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

"and" and "or" keywords



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]