🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #51283

assert and __FUNCTION__

#51283
From: Marty Leisner x71348
Date: Wed, 09 Jun 1993 20:05
29 lines
1391 bytes
 
I like the fact rms finally put  __FUNCTION__ in as a
predefined.

I used Aztec for years and it was very useful.



#ifdef __GNUC__
# ifndef NDEBUG
# define _assert(ex)	{if (!(ex)){(void)fprintf(stderr,"Assertion failed: file " __FILE__ "line %d function  "  __FUNCTION__ " \n", __LINE__);abort(1);}}
# define assert(ex)	_assert(ex)
# else
# define _assert(ex)
# define assert(ex)
# endif
#else
#include <assert.h>
#endif 

Isn't assert supposed to call abort?  (the sunos one called exit).

How do I test for a version which supports this?

--
Marty Leisner	leisner@eso.mc.xerox.com   leisner.henr801c@xerox.com
Good tools upgrade man" -- Thomas Watson, Jr.  
	"The Machine that Changed the World"
Technical Details
Message-ID: <1993Jun9.200518.18718@spectrum.xerox.com>
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!darwin.sura.net!bogus.sura.net!news-feed-1.peachnet.edu!concert!rutgers!rochester!rocksanne!hydrus!leisner

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,4d74803d81b918ed,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-06-09 17:29:12 PST
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!darwin.sura.net!bogus.sura.net!news-feed-1.peachnet.edu!concert!rutgers!rochester!rocksanne!hydrus!leisner
From: leisner@hydrus (Marty Leisner x71348 )
Newsgroups: gnu.gcc.help
Subject: assert and __FUNCTION__
Message-ID: <1993Jun9.200518.18718@spectrum.xerox.com>
Date: 9 Jun 93 20:05:18 GMT
Sender: news@spectrum.xerox.com
Reply-To: leisner@eso.mc.xerox.com
Organization: Xerox
Lines: 29
X-Newsreader: TIN [version 1.2 PL0]