delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2004/01/08/04:32:38

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
Date: 08 Jan 2004 11:34:05 +0200
Message-Id: <usmiq238y.fsf@elta.co.il>
From: Eli Zaretskii <eliz AT elta DOT co DOT il>
To: djgpp-workers AT delorie DOT com
In-reply-to: <3FFCF1F4.B86AC9DA@yahoo.com> (message from CBFalconer on Thu, 08
Jan 2004 01:00:20 -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>
Note-from-DJ: This may be spam
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: Thu, 08 Jan 2004 01:00:20 -0500
> From: CBFalconer <cbfalconer AT yahoo DOT com>
> > 
> > #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
> >   || !defined(__STRICT_ANSI__)
> > 
> > #define bool _Bool
> > #define true 1
> > #define false 0
> > #define __bool_true_false_are_defined 1
> > 
> > #endif /* (__STDC_VERSION__ >= 199901L) || !__STRICT_ANSI__ */
> > 
> > #endif /* !__dj_stdbool__h_ */
> 
> I question whether it is necessary to have the __STDC_VERSION etc.
> guard, or even desirable.  I see no reason why a c90 user should
> not provide a stdbool.h system file and expect it to be used.  As
> you point out, those contents are pretty universal, although a C90
> version would not be able to use _Bool.  And a C99 user may well
> want to use bool etc. without insisting on strict Ansi.

But that's exactly what these guards do: if you do NOT ask for strict
ANSI, you DO have `bool' etc., even under C89.  If you DO ask for
ANSI C, then they are available only under C9x, because strict-ANSI
programs that are compliant to C89 should not have their namespace
polluted by `bool'.

Or did I miss something?

- Raw text -


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