Messages in this thread | | | Date | Sun, 26 Feb 2006 19:23:55 +0100 | From | "Jesper Juhl" <> | Subject | Re: [PATCH] silence gcc warning about possibly uninitialized use of variable in scsi_scan |
| |
On 2/26/06, James Bottomley <James.Bottomley@steeleye.com> wrote: > On Sun, 2006-02-26 at 16:39 +0100, Jesper Juhl wrote: > > Gcc can't see that 'result' will always be initialized inside the for loop > > and thus it warns > > drivers/scsi/scsi_scan.c:445: warning: 'result' might be used uninitialized in this function > > This patch silences the warning by initializing 'result' to zero. > > Really, this is a gcc bug. My version of the compiler: > > gcc version 4.0.3 20051201 (prerelease) (Debian 4.0.2-5) > > Doesn't give this warning. And, since the loop has fixed parameters, > gcc should see not only that it's always executed, but that it could be > unrolled. > > Which version is causing the problem? > 2.6.16-rc4-mm2 build with gcc 3.4.5
and I agree that gcc really should be noticing, but in fact it doesn't. It's no big deal, I just thought we might want to shut gcc up and give people one less warning to worry about.
-- Jesper Juhl <jesper.juhl@gmail.com> Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html Plain text mails only, please http://www.expita.com/nomime.html - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |