[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: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Fri, 13 Jun 2008 18:53:24 +0200

Branko Čibej wrote:
> I disagree with this idea. Very very much in fact. It's contrary to the
> API implementation rules we set up from day one -- one of which says
> that our API will not validate parameters. Also it would mean that all
> functions that use assert but happen not to return an svn_eror_t would
> have to be revved.
> The above implies that
> * assert should only be used for "this can't happen" sanity checks

I disagree: assert should *never* be used, unless it's enclosed in
#ifdef _DEBUG statements.

> * it should be turned off in production code (which is what we do on
> Windows, IIRC).

Not really. The c-runtime assert() function is still used in a release

See issue 2780:

I've asked for the removal of asserts and aborts several times already,
and I think I made my reasons very clear for that.
And as you can see from that issue, I'm not the only one who has many
problems because of those asserts and aborts.

(that's also why I'm still considering dropping serf for the TSVN 1.5
release - it has way too many aborts in places where an error should be
returned instead).


   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net

Received on 2008-06-13 18:54:08 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.