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 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: References: <3FC27F1A DOT 61184929 AT phekda DOT freeserve DOT co DOT uk> <3FC3D7E6 DOT 97B87A40 AT phekda DOT freeserve DOT co DOT uk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk 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/