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

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

From: Branko Čibej <brane_at_xbc.nu>
Date: Thu, 19 Jun 2008 16:16:59 +0200

Vincent Lefevre wrote:
> On 2008-06-18 16:01:49 +0100, Julian Foad wrote:
>
>> * "I do think that there is value in having a way of assert/aborting
>> from anywhere in the code (not just svn_error_t-returning functions)
>> which can't be ignored accidentally by forgetting to write SVN_ERR and
>> friends." [DG]
>>
>> -> The traditional (standard) assert()/abort() achieves this, but I
>> think you also accept that in the libraries we need to make such errors
>> trappable by the calling program. My proposal solves this for the
>> functions where an error return is available. I have no solution for the
>> other functions, so they can continue to use the traditional
>> assert()/abort().
>>
>
> Shouldn't these functions be modified to return a svn_error_t, or
> isn't it possible (API compatibility)?
>

We can always add a newer version of such functions, when that makes
sense. In the specific case of string functions that ghudson mentioned,
I really don't think makes sense though. I think there's a limit to how
much safety net we want to add, otherwise we'll end up with 30% of our
code just doing error checking.

-- Brane

---------------------------------------------------------------------
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-19 16:17:23 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.