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

Re: Shutting up warnings

From: Peter N. Lundblad <peter_at_famlundblad.se>
Date: 2005-11-22 20:57:23 CET

On Tue, 22 Nov 2005, Julian Foad wrote:

> Peter N. Lundblad wrote:
> > On Mon, 21 Nov 2005, Julian Foad wrote:
> >
> > Here we go. The problem seems to be that if you pass a variable by
> > reference to a function whihc is expected to fill in the variable value,
> > the compiler is pesimistic about this.
> > I can go fixing these if people
> > don't object. I'm not opposed to shutting up warnings per se. I more want
> > us to resolve the question before going on and doing this in particular
> > cases.
> I think it would definitely be wrong to initialise these variables just to
> avoid the warnings. It would be illogical since they are always being
> initialised by the existing code, and it could hide genuine errors as has been
> pointed out before.
I agree with this and think we should either be consistent in adding code
to silence these warnings or not doing it. Shutting warnings only for gcc3
is pointless.

> This is clearly the kind of warning that is suitable only for occasional use
> (when somebody feels like checking all of the reported possible problems), or
> perhaps for use on code where output parameters are specially marked so the
> compiler knows that's what they are. Just like the "Function argument is
> unused" warning that was discussed a few weeks ago.
Yes, it's not useful to us in routine builds.

> The same applies in theory to the case that I just told Eric he should "fix".
> (What's the word I need? "Indulge the compiler"?) I think I have just made up
> my mind that we should _not_ generally add code just to avoid these speculative
> kinds of warnings. Erik's particular case was the only remaining instance of a
> particular kind, so the benefit-to-clutter ratio was high. (I imagined several
> instances of that kind had existed and been "fixed", but I'm not sure.)
The problem with Erik's fix was that it adds code to set a value to NULL
that will never be used. That's confusing to me and that was why I reacted
in the first place.

So the conclusion seems to be that we shouldn't care about GCC's
uninitialized warnings, at least not until GCC gets smarter in this
regard. Did I interpret your comments correct, and do others agrre to


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Nov 22 20:58:50 2005

This is an archived mail posted to the Subversion Dev mailing list.