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

pointers and Windows debugging

From: John Barstow <John_Barstow_at_gfsg.co.nz>
Date: 2003-01-07 00:40:15 CET

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.

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.

I know there have been bugs involving uninitialized ponters, if not as many
as I might expect. Is there a reason we don't do these things? If it's
just 'not enough time', I can create and submit some patches to address
this. If there's a deeper reason, or if I'm just missing something obvious,
then of course I defer to the people doing the bulk of the work.

John C Barstow

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