[OT] Re: assert{ 2.0 } - a new kind of assertion
- From: Robert Klemme <shortcutter@xxxxxxxxxxxxxx>
- Date: Tue, 29 Jan 2008 20:25:39 +0100
On 29.01.2008 19:02, Paul E. Black wrote:
Very nice! I've used C's macro pre-processor to do something like
that for some 20 years.
#ifdef RIGOROUS
#define ASSERT(ex) {if(!(ex))fprintf(stderr,"ex false in %s, line %d\n",__FILE__,__LINE__);}
#else
#define ASSERT(ex)
#endif
My C is a bit rusty these days but isn't it safer to define the non assertion case as
#defind ASSERT(ex) /* ex */
i.e. at least generate an empty comment? Otherwise you get only whitespace and parsing of the source my change.
Kind regards
robert
.
- Prev by Date: Re: Why is Object Oriented so successfull
- Next by Date: Re: assert{ 2.0 } - a new kind of assertion
- Previous by thread: CFP: DATICS 2008 - Design, Analysis and Tools for Integrated Circuits and Systems
- Next by thread: Re: assert{ 2.0 } - a new kind of assertion
- Index(es):
Relevant Pages
|