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

Re: Karl, subversion/libsvn_client/log.c

From: Karl Fogel <kfogel_at_newton.ch.collab.net>
Date: 2003-01-03 05:21:30 CET

Blair Zajac <blair@orcaware.com> writes:
> Your 4186 commit on subversion/libsvn_client/log.c in svn_client_log
> now gets this warning message with gcc 3.2.1 on my RedHat 8.0 box:
>
> subversion/libsvn_client/log.c: In function `svn_client_log':
> subversion/libsvn_client/log.c:67: warning: `err' might be used
> uninitialized in this function
>
> The following patch fixes the warning, but is this a good solution
> for the issue? It's not clear to me if setting err just covers up
> a logic flow issue.

Logically it can't ever be null (because we ensure there's at least
one target). I'll commit the patch to silence the warning, though,
thanks for the heads-up.

-Karl

> Index: subversion/libsvn_client/log.c
> ===================================================================
> --- subversion/libsvn_client/log.c (revision 4235)
> +++ subversion/libsvn_client/log.c (working copy)
> @@ -64,7 +64,7 @@
> const char *auth_dir;
> apr_array_header_t *condensed_targets;
> svn_revnum_t start_revnum, end_revnum;
> - svn_error_t *err;
> + svn_error_t *err = SVN_NO_ERROR; /* Silence a gcc uninitialized warning */
>
> if ((start->kind == svn_opt_revision_unspecified)
> || (end->kind == svn_opt_revision_unspecified))
>
> Best,
> Blair
>
> --
> Blair Zajac <blair@orcaware.com>
> Plots of your system's performance - http://www.orcaware.com/orca/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Jan 3 06:05:18 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.