From: Boon van der RJ Newsgroups: comp.os.msdos.djgpp Subject: Re: Some questions, and some bugs (perhaps) Date: 23 Oct 1998 11:18:59 GMT Organization: Fac. Wiskunde & Informatica, VU, Amsterdam Lines: 52 Message-ID: <70pon3$bv7$1@star.cs.vu.nl> References: NNTP-Posting-Host: sloep68.cs.vu.nl User-Agent: tin/pre-1.4-981002 ("Phobia") (UNIX) (SunOS/5.5.1 (sun4m)) Originator: rjvdboon AT sloep68 DOT cs DOT vu DOT nl To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Mike Ruskai wrote: > On Thu, 22 Oct 1998 21:05:22 +0100, D. Vrabel wrote: >>false and true are keywords in C++ (I asume your talking about C++). Use >>the bool type for boolean variables. > Since when? They aren't in the other two compilers, which is what makes the > above necessary. Then the other two are not adhering to the (upcoming?) standards. The Dec 1996 C++-draft already stated (see below) gcc has done this since 2.7.x (i think, 2.6.3 didn't follow the draft AFAIK. Was there a draft back then?) It's easy to work around. Use #if ! (defined( __GNUC__) && defined(__cplusplus)) enum bool {false=0, true=1}; #endif and use bool throughout your code. ==== quote from draft: ==== 2.11 Keywords [lex.key] 1 The identifiers shown in Table 3 are reserved for use as keywords (that is, they are unconditionally treated as keywords in phase 7): Table 3--keywords +-----------------------------------------------------------------------+ |asm do inline short typeid | |auto double int signed typename | |bool dynamic_cast long sizeof union | |break else mutable static unsigned | |case enum namespace static_cast using | |catch explicit new struct virtual | |char extern operator switch void | |class false private template volatile | |const float protected this wchar_t | |const_cast for public throw while | |continue friend register true | |default goto reinterpret_cast try | |delete if return typedef | +-----------------------------------------------------------------------+ === end quote from draft === See (same draft): http://www.csci.csusb.edu/dick/c++std/cd2/lex.html#lex.key http://www.cygnus.com/misc/wp/dec96pub/lex.html#lex.key http://www.maths.warwick.ac.uk/cpp/pub/wp/html/cd2/lex.html#lex.key hth, Robert. -- rjvdboon AT cs DOT vu DOT nl | "En dat is niet waar!" sprak ex-Staatsecretaris- www.cs.vu.nl/~rjvdboon | van-Onderwijs Netelenbos fel.