delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1996/10/29/12:45:49

From: Steven_R_Goncalo AT ccmail DOT res DOT ray DOT com
Subject: Re: syntax error?
29 Oct 1996 12:45:49 -0800 :
Sender: daemon AT cygnus DOT com
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <9609298466.AA846618273.cygnus.gnu-win32@ccmail.res.ray.com>
Encoding: 48 Text
Original-To: gnu-win32 AT cygnus DOT com, David Jeffers <jeffers AT redrose DOT net>
Original-Sender: owner-gnu-win32 AT cygnus DOT com

ANSI/ISO C++ includes a built in Boolean data type called bool,
with predefined values true and false. All three are now reserved
keywords. I would suspect that there may be a compiler switch to suppress
this for backwards compatibility (like the stricter use of enums, this
"improved" feature came at the cost of some real breakage in existing code). I 
don't have the latest GCC here at work to check to see if this is defeatable, 
but you may be better off using the new type anyway.


______________________________ Reply Separator _________________________________
Subject: syntax error?
Author:  David Jeffers <jeffers AT redrose DOT net> at SMTP
Date:    10/29/96 9:03 AM



Here's the file:

misc.h
--------------------------------
#ifndef misc_h
#define misc_h

const int false = 0;
const int true = 1;

#endif
--------------------------------

Here's the error message:

$ in file included from buffer.h:24, 
$     from buffer.cpp:25
$ misc.h:18 syntax error before 'false' 
$ misc.h:19 syntax error before 'true'


Can someone explain this error message or where the 
syntax error is?

-- 

    David Jeffers     
<jeffers AT redrose DOT net>

-
For help on using this list, send a message to 
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019