linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: bugme-daemon@bugzilla.kernel.org
Cc: linux-ext4@vger.kernel.org
Subject: Re: [Bug 12676] New: fs/ext4/extents.c: In function  ‘ext4 ext search right’: fs/ext4/extents.c:1120: warning:  ‘ix’ may be used uninitialized in this function
Date: Tue, 10 Feb 2009 08:25:13 -0500	[thread overview]
Message-ID: <20090210132513.GD30689@mini-me.lan> (raw)
In-Reply-To: <bug-12676-13602@http.bugzilla.kernel.org/>

On Mon, Feb 09, 2009 at 03:15:49AM -0800, bugme-daemon@bugzilla.kernel.org wrote:
> http://bugzilla.kernel.org/show_bug.cgi?id=12676
> 
>            Summary: fs/ext4/extents.c: In function
>                     ‘ext4_ext_search_right’: fs/ext4/extents.c:1120:
>                     warning: ‘ix’ may be used uninitialized in this
>                     function

> When compiling gets this error on Ext4 FS:
> "fs/ext4/extents.c: In function ‘ext4_ext_search_right’:
> fs/ext4/extents.c:1120: warning: ‘ix’ may be used uninitialized in this
> function
> "

What version of gcc are you using to compile your kernel?  This looks
like the case of "gcc is stupid not to notice that depth must be
non-zero, so ix is always initialized".  Which doesn't seem to be the
case with gcc 4.3.2, but it might be true with an older version of
gcc.

We can shut up gcc by forcibly initializing ix, but if this is only a
problem with older gcc's, as it seems, it's probably best not to
clutter the source (and the compiled binary) with an unneeded
initialization:

	/* go up and search for index to the right */
	while (--depth >= 0) {
		ix = path[depth].p_idx;
		if (ix != EXT_LAST_INDEX(path[depth].p_hdr))
			goto got_index;
	}

	/* we've gone up to the root and found no index to the right */
	return 0;

got_index:
	/* we've found index to the right, let's
	 * follow it and find the closest allocated
	 * block to the right */
	ix++;
        ^^^^^ Gee, aren't (some verions of) gcc stupid?


	      	   	  		    	- Ted

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2009-02-10 18:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-09 11:15 [Bug 12676] New: fs/ext4/extents.c: In function ‘ext4 ext search right’: fs/ext4/extents.c:1120: warning: ‘ix’ may be used uninitialized in this function bugme-daemon
2009-02-09 16:10 ` [Bug 12676] " bugme-daemon
2009-02-10 13:25 ` Theodore Tso [this message]
2009-02-10 18:21 ` bugme-daemon
2009-05-19 18:36 ` [Bug 12676] fs/ext4/extents.c: In function ‘ext4_ext_search_right’: " bugzilla-daemon

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=20090210132513.GD30689@mini-me.lan \
    --to=tytso@mit.edu \
    --cc=bugme-daemon@bugzilla.kernel.org \
    --cc=linux-ext4@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;
as well as URLs for NNTP newsgroup(s).