From: "Jesper Juhl" <jesper.juhl@gmail.com>
To: "James Bottomley" <James.Bottomley@steeleye.com>
Cc: linux-kernel@vger.kernel.org, "Eric Youngdale" <ericy@cais.com>,
"Eric Youngdale" <eric@andante.org>,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH] silence gcc warning about possibly uninitialized use of variable in scsi_scan
Date: Sun, 26 Feb 2006 19:23:55 +0100 [thread overview]
Message-ID: <9a8748490602261023j46eb39f2peaa080d737fee5e1@mail.gmail.com> (raw)
In-Reply-To: <1140978084.3692.6.camel@mulgrave.il.steeleye.com>
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
next prev parent reply other threads:[~2006-02-26 18:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200602261639.15657.jesper.juhl@gmail.com>
2006-02-26 18:21 ` James Bottomley
2006-02-26 18:23 ` Jesper Juhl [this message]
2006-02-26 18:59 ` James Bottomley
2006-02-26 19:01 ` Jesper Juhl
2006-02-26 19:21 ` James Bottomley
2006-02-26 20:41 ` Jesper Juhl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9a8748490602261023j46eb39f2peaa080d737fee5e1@mail.gmail.com \
--to=jesper.juhl@gmail.com \
--cc=James.Bottomley@steeleye.com \
--cc=eric@andante.org \
--cc=ericy@cais.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®