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

Re: pointers and Windows debugging

From: Justin Erenkrantz <jerenkrantz_at_apache.org>
Date: 2003-01-07 05:35:38 CET

--On Monday, January 6, 2003 10:37 PM -0500 Greg Hudson
<ghudson@MIT.EDU> wrote:

> (As far as I know, assertions are always turned on unless you
> compile a program with NDEBUG defined. We have no build support
> for defining NDEBUG, so I don't buy the argument that assertions
> are harmful because they might be turned off. If our assertions
> have been turned off, it's because someone tried hard.)

IIRC, certain compilers implicitly disable assertions on specific
optimization levels. I wish I could remember the specifics.

My perspective on asserts is that if it is important enough to be an
assert that is always present, it shouldn't be allowed to be removed
- hence not an assert. Basically, it's the argument we use in APR.
If Ryan and Greg agree on something, it's Guaranteed to be Right(TM).

Furthermore, a note that I haven't seen yet in this thread is that a
library should never call assert(). Only applications should call
assert(). A library that causes a SIGABRT because of a consistency
failure isn't a library that should be relied upon. It is better to
error out gracefully. Since the bulk of our code is meant to be used
as a library, this is, IMHO, a prime concern. -- justin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jan 7 05:36:44 2003

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.