[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: Keven Ring <keven_at_mitre.org>
Date: 2004-11-11 02:04:44 CET

Justin Erenkrantz wrote:

> --On Thursday, November 11, 2004 1:19 AM +0100 "Branko ?ibej"
> <brane@xbc.nu> wrote:
>
>>> 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, you'd incur a double penalty when assert is defined. That's
> badness, IMHO. -- justin
>
As an impartial, outside observer, would the following (or similar) be
appealing to people instead?

#ifdef NDEBUG
  #define verify(x) <whatever you want to use>
#else
  #define verify(x) <whatever you want to use>
#endif

Just my $0.02.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Nov 11 02:05:06 2004

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.