[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: abort or verify?

From: Branko Čibej <brane_at_xbc.nu>
Date: 2004-11-11 01:19:28 CET

Justin Erenkrantz wrote:

>> Let me propose to use "verify" instead of "assert", where "verify" is
>> defined to be the same as "assert" except that it is always enabled
>> (i.e.
>> even when NDEBUG is defined). This will achieve points (1), (2) and
>> (3),
>> and will leave the checks active all the time.
>>
>> Would this be acceptable to everyone?
>
>
> I'm not sure how you'd have it defined to be the same. The expansion
> of assert() is different on each platform, IIRC.

Yes, but the following would almost do the trick:

    #define verify(x) do { assert(x); if (!(x)) abort(); } while(1)

> But, if you satisfy the requirement that the checks always occur, then
> I'd only be +0.5 just because I think it's a lot of turmoil for little
> actual benefit. -- justin

Quite.

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Nov 11 01:19:31 2004

This is an archived mail posted to the Subversion Dev mailing list.