[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: Garrett Rooney <rooneg_at_electricjellyfish.net>
Date: 2003-01-07 01:01:27 CET

On Monday, January 6, 2003, at 06:40 PM, John Barstow wrote:

> Two things I've been noticing in the code lately seem odd. Probably
> it's
> just my background, but I feel somewhat disquieted by them.
> 1) Pointers are not initialized to NULL. This may not matter too
> much on
> Unix, but on Windows, uninitialized pointers point to random locations
> in
> memory. This makes debugging very painful and bugs very unpredictable
> -
> especially since the problem is less pronounced in debug mode.

if you can point out a location where we're using a pointer before we
initialize it, then that's a bug and we'd love to hear about it. while
many places don't necessarily set the pointer to NULL explicitly, they
should always be setting it to something before we use it.

> 2) There are no asserts() or other debug-time checks of parameters.
> Maybe
> this activity is being masked by macros, but I see pointers being
> passed,
> then used, with no checks for NULL values. I don't expect a C program
> to be
> doing runtime checks, but I do generally expect debug-time checks.

there are some asserts(), not a ton, but some. we don't check for
NULL's as a conscious design decision, the idea being that it's better
to crash explicitly during development than to jump through hoops to
have everything work when a NULL pointer is passed. the APR and apache
people use a similar philosophy, so perhaps some of them can explain it


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jan 7 01:02:25 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.