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

Re: use of SVN_ERR_ASSERT (was: svn commit: r1302682 ...)

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Thu, 22 Mar 2012 22:26:12 +0000 (GMT)

Greg Stein wrote:

> There you go. r1304079.
>
> You still concerned about SVN_ERR_ASSERT, or was this thread/time for
> nothing, and it was really about this one usage?

Thanks for the fix, Greg.

Sorry that I communicated imprecisely at the beginning of this thread.  Just to clarify myself, for my part I was concerned only with "temporarily" using an assertion as a substitute for a normal error check.  (And I assume Daniel meant the same.)  I don't have an absolute abhorrence, it's just that we've been caught out before in not having got around to replacing them with proper checks.

In that regard, I don't care whether we're talking about an assertion macro that can be redirected into an svn error chain (such as SVN_ERR_ASSERT) or not (such as 'assert' or 'if (...) abort').  The fact that an app can 'catch' SVN_ERR_ASSERT exceptions does not make it any more acceptable to use it for normal error checking; theoretically because that's a confusion of meaning, and pragmatically because the 'catch' code may want to assume the process state is unstable and so shut down anyway, although doing its best to be friendly about it.

And just a reminder to all readers that we're perfectly free to define a convenient checking macro (or several) so we can write e.g. "CHECK(data[len] == '\0')" instead of long-hand error checking code, wherever we find that helpful.

- Julian
Received on 2012-03-22 23:26:48 CET

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.