delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/11/26/06:35:30

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
Date: Wed, 26 Nov 2003 13:34:24 +0200 (EET)
From: Esa A E Peuha <peuha AT cc DOT helsinki DOT fi>
Sender: peuha AT sirppi DOT helsinki DOT fi
To: djgpp-workers AT delorie DOT com
Subject: Re: C99 and assert
In-Reply-To: <3FC3D7E6.97B87A40@phekda.freeserve.co.uk>
Message-ID: <Pine.OSF.4.58.0311261303470.1821@sirppi.helsinki.fi>
References: <Pine DOT OSF DOT 4 DOT 58 DOT 0311171215310 DOT 18135 AT sirppi DOT helsinki DOT fi>
<3FC27F1A DOT 61184929 AT phekda DOT freeserve DOT co DOT uk> <Pine DOT OSF DOT 4 DOT 58 DOT 0311251030350 DOT 13833 AT sirppi DOT helsinki DOT fi>
<3FC3D7E6 DOT 97B87A40 AT phekda DOT freeserve DOT co DOT uk>
MIME-Version: 1.0
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

On Tue, 25 Nov 2003, Richard Dawe wrote:

> Maybe it would be good to have C99-standard assert available by default? E.g.:
>
>     #if !defined(__STRICT_ANSI__) || (C99-defines)
>     ...
>     #endif
>
> This may require some checking of the gcc version.

Gcc will default to -std=gnu99 sooner or later, and then the C99
compliant assert will be the default.  FWIW, I'm actually against having
the function name on assert's failure message; it just makes it longer
for no good reason (if I need to know the function's name, I can read it
from the stack traceback or straight from the source when I look at it
to see why it failed).  Therefore I'm inclined to do the minimum needed
to comply with C99, which is what the patch does.

> Note that gcc's C99 mode (-std=c99) didn't seem to do much, last time I tried
> it. Maybe it's better in gcc 3.3.x?

Maybe a little, but still not very good; see
http://gcc.gnu.org/gcc-3.3/c99status.html (about C99 support in general,
not the effects of -std=c99).

-- 
Esa Peuha
student of mathematics at the University of Helsinki
http://www.helsinki.fi/~peuha/

- Raw text -


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