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

Re: [RFC] Replacement for "assert" in the libraries

From: Vincent Lefevre <vincent+svn_at_vinc17.org>
Date: Wed, 18 Jun 2008 03:27:30 +0200

On 2008-06-17 15:37:47 -0700, David Glasser wrote:
> On Tue, Jun 17, 2008 at 2:49 PM, Martin Furter <mf_at_rola.ch> wrote:
> > #ifdef MAINTAINER_MODE
> > #define SVN_ASSERT(x) assert(x)
> > #else
> > #define SVN_ASSERT(x) if(x) return svn_error_create(...)
> > #endif
> >
> > Wouln't that be enough?
>
> So when I'm building in maintainer mode (ie, all my active dev), I can
> happily write void functions with SVN_ASSERT in them, which fail to
> compile without maintainer mode? No thanks.

This is fixable:

#ifdef MAINTAINER_MODE
#define SVN_ASSERT(x) do assert(x); while (0)
#else
#define SVN_ASSERT(x) do if(x) return svn_error_create(...); while (0)
#endif

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-06-18 03:28:02 CEST

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.