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

Re: Inconsistent "might be used uninitialized in this function" warnings

From: Dan Wilder <dan_at_ssc.com>
Date: 2002-12-15 06:13:10 CET

On Sat, Dec 14, 2002 at 02:56:22PM +0000, Philip Martin wrote:
> Blair Zajac <blair@orcaware.com> writes:
>
> > subversion/libsvn_wc/adm_ops.c: In function `svn_wc_delete':
> > subversion/libsvn_wc/adm_ops.c:645: warning: `was_deleted' might be used
> > uninitialized in this function
> >
> > subversion/clients/cmdline/status.c: In function `print_status':
> > subversion/clients/cmdline/status.c:61: warning: `ood_status' might be
> > used uninitialized in this function
>
> By inspection one can see that there is no code path that uses the
> variables if they have not been initialized. I suppose we could
> change the code to make the compiler quiet, but the warnings do not
> indicate a bug. I guess the warning uses "might" because it does not
> always get it right.

I'd change the code.

Mostly the changes for this sort of thing are pretty harmless
and trivial. The benefit is it keeps the compiler quiet about
things you already know about, making it less likely new things
that make it complain will go uninspected.

-- 
-----------------------------------------------------------------
 Dan Wilder <dan@ssc.com>   Technical Manager
 SSC, Inc. P.O. Box 55549   Phone:  206-782-8808
 Seattle, WA  98155-0549    URL http://www.linuxjournal.com/
-----------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Dec 15 06:13:54 2002

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.