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

Re: [PATCH] Issue 443 : post-commit hook (error) output lost: Step 6

From: Garrett Rooney <rooneg_at_electricjellyfish.net>
Date: 2005-10-20 01:37:47 CEST

> > - const char *log_msg, *date, *author;
> > + const char *log_msg = NULL,
> > + *date = NULL,
> > + *author = NULL,
> > + *post_commit_err = NULL;
> >
> > Any reason these are now being initialized to NULL?
>
> Good practice, is it not?

If something depends on them being initialized to NULL, then by all
means they should be initialized, but if we're going to initialize
them to some value later (as this code does, by passing them to a
function that fills them in), then leaving out the explicit setting to
NULL gives the compiler a chance to warn in cases where they will be
used without being initialized. The explicit NULL keeps the compiler
from being able to do that.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Oct 20 01:39:01 2005

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.