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

Re: assert() vs. return(error)

From: Branko ─îibej <brane_at_xbc.nu>
Date: 2006-02-14 09:03:56 CET

Stuart Celarier wrote:
> All of the literature on assert (per se) seems to be mostly irrelevant
> because the Subversion code uses assert in a non-standard way [1].
>
> The rest of the C world uses the assert macro to compile assertions in
> to the debug version, and to remove assertions in the release version.
> Subversion always compiles with assertions in the code, including the
> release version.
>
Ah hah. And that "rest of the world" also does not generate debug
symbols for release mode builds, yes? We "violate" that "rule" too, luckily.

The "unwritten policy" about Subversion and assert is that we use assert
to check for conditions that "can't happen". That obviously means we
can't use assert to check function arguments, and it's especially evil
if a malicious client can trigger an assert on the server.

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Feb 14 09:04:26 2006

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