This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: "and" and "or" keywords
- From: Oliver Kullmann <O dot Kullmann at Swansea dot ac dot uk>
- To: y2bismil at engmail dot uwaterloo dot ca, gcc-help at gcc dot gnu dot org
- Date: Fri, 3 Oct 2003 17:52:59 +0100
- Subject: Re: "and" and "or" keywords
- References: <1065199512.3f7da79843954@www.nexusmail.uwaterloo.ca>
On Fri, Oct 03, 2003 at 12:45:12PM -0400, y2bismil@engmail.uwaterloo.ca wrote:
> Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm
> Precedence: bulk
> List-Unsubscribe: <mailto:gcc-help-unsubscribe-O.Kullmann=swansea.ac.uk@gcc.gnu.org>
> List-Archive: <http://gcc.gnu.org/ml/gcc-help/>
> List-Post: <mailto:gcc-help@gcc.gnu.org>
> List-Help: <mailto:gcc-help-help@gcc.gnu.org>
> Delivered-To: mailing list gcc-help@gcc.gnu.org
> X-Authentication-Warning: ecserv7.uwaterloo.ca: www set sender to y2bismil@engmail.uwaterloo.ca using -f
> Date: Fri, 3 Oct 2003 12:45:12 -0400
> From: y2bismil@engmail.uwaterloo.ca
> To: gcc-help@gcc.gnu.org
> User-Agent: Internet Messaging Program (IMP) 3.1 / FreeBSD-4.6.2
> X-Originating-IP: 207.245.22.25
> X-SA-Exim-Mail-From: gcc-help-return-14106-O.Kullmann=swansea.ac.uk@gcc.gnu.org
> Subject: "and" and "or" keywords
> X-Spam-Checker-Version: SpamAssassin 2.60-rc1 (1.197-2003-08-21-exp) on harpo
> X-Spam-Level:
> X-Spam-Status: No, hits=0.3 required=5.5 tests=NO_REAL_NAME autolearn=no
> version=2.60-rc1
> X-SA-Exim-Version: 3.1 (built Fri Aug 22 12:30:01 GMT 2003)
> X-UIDL: 70N!!Q\6"!eg<!!ChT"!
>
>
>
> 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
>
>
Hi, according to Table 4, "Alternative representations" from
the Standard (page 14, ISO 14882:1998(E)) "and" and "or"
"are reserved and shall not be used otherwise".
Oliver