mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@SteelEye.com>
To: Jesper Juhl <jesper.juhl@gmail.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 12:21:24 -0600	[thread overview]
Message-ID: <1140978084.3692.6.camel@mulgrave.il.steeleye.com> (raw)
In-Reply-To: <200602261639.15657.jesper.juhl@gmail.com>

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?

James



       reply	other threads:[~2006-02-26 18:21 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 [this message]
2006-02-26 18:23   ` Jesper Juhl
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=1140978084.3692.6.camel@mulgrave.il.steeleye.com \
    --to=james.bottomley@steeleye.com \
    --cc=eric@andante.org \
    --cc=ericy@cais.com \
    --cc=jesper.juhl@gmail.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®