www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2004/01/11/12:43:31

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
Date: Sun, 11 Jan 2004 19:39:09 +0200
From: "Eli Zaretskii" <eliz AT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: djgpp-workers AT delorie DOT com
Message-Id: <5567-Sun11Jan2004193908+0200-eliz@elta.co.il>
X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9
In-reply-to: <4000FCEF.14978894@yahoo.com> (message from CBFalconer on Sun, 11
Jan 2004 02:36:15 -0500)
Subject: Re: stdbool.h and complex.h
References: <Pine DOT OSF DOT 4 DOT 58 DOT 0401071356580 DOT 26260 AT sirppi DOT helsinki DOT fi> <3FFCF1F4 DOT B86AC9DA AT yahoo DOT com> <Pine DOT OSF DOT 4 DOT 58 DOT 0401081156010 DOT 23737 AT sirppi DOT helsinki DOT fi> <3FFDEB2F DOT F9560613 AT yahoo DOT com> <9003-Fri09Jan2004105245+0200-eliz AT elta DOT co DOT il> <3FFE97BE DOT 4CA94BA3 AT yahoo DOT com> <3FFF2420 DOT 7090305 AT phekda DOT gotadsl DOT co DOT uk> <3FFF586F DOT 611F9247 AT yahoo DOT com> <3405-Sat10Jan2004133647+0200-eliz AT elta DOT co DOT il> <400034C9 DOT B3F8281D AT yahoo DOT com> <7105-Sat10Jan2004222934+0200-eliz AT elta DOT co DOT il> <4000FCEF DOT 14978894 AT yahoo DOT com>
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Date: Sun, 11 Jan 2004 02:36:15 -0500
> From: CBFalconer <cbfalconer AT yahoo DOT com>
> > 
> >  #define bool _Bool
> > 
> > which, I think is perfectly okay.  What doesn't exist here? _Bool?
> > It's built into GCC, AFAIK.
> 
> Not for K&R/C89/C90/C95.  _Bool does not exist for these.  The
> declaration "_Bool boolthing;" should result in an undefined
> error.

If you want this, you should compile with __STRICT_ANSI__, and then
_Bool should trigger an error.  At least, our headers won't use _Bool
in that case.

> If the above #define has occurred, that error will result
> from the innocuous "bool boolthing;", and attempts to redefine
> bool with "#define bool int" will also result in confusing error
> messages.

It doesn't occur under strict ANSI compilation, which is all the user
should hope for.

> We may be approaching this from different viewpoints. Mine is that
> code should adhere to ISO standards, and that special efforts are
> needed to deviate from that.

That is indeed different from the whole library's philosophy, which
is the other way around: unless you request strict ANSI, you don't
get it.

> I consider GNU standards to be such
> a deviation, and so run gcc with -ansi -pedantic by default.

Then the suggested stdbool.h should be fine for you.

- Raw text -


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