lkml.org 
[lkml]   [2009]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [2.6.29-rc2-git2] compilation warnings
Hi Takashi,

On Tue, 27 Jan 2009 10:34:20 +0100, Takashi Iwai wrote:
> At Tue, 27 Jan 2009 09:46:28 +0100,
> > On Tue, 27 Jan 2009 08:32:17 +0100, Takashi Iwai wrote:
> > > A bogus warning. Ignore this.
> >
> > No matter how bogus it is, it should be fixed. Otherwise this is
> > wasting the time of users and developers over and over again.
>
> Well, it's a bug of gcc appearing only in a certain version, so most
> people won't see it.
>
> Of course, we can put uninitialized_var(). But, I don't basically
> like adding it unconditionally...

I didn't know about uninitialized_var(), thanks for the hint.

My experience with these warnings is that, in many cases, it is
possible to write the code differently so that it is clear to the
compiler that the variable is never used uninitialized. In some cases,
doing so also makes the code easier to read for humans and less likely
to break in the future.

Of course, in some cases the problem is simply that the compiler is too
stupid to understand even simple things, but in other cases these
warnings might be a good opportunity to rewrite the code in a way that
is easier to understand.

--
Jean Delvare


\
 
 \ /
  Last update: 2009-01-27 13:51    [from the cache]
©2003-2011 Jasper Spaans