public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: kbuild test robot <fengguang.wu@intel.com>
Cc: Jan Kara <jack@suse.cz>,
	kbuild-all@01.org, sfr@canb.auug.org.au,
	linux-ext4@vger.kernel.org
Subject: Re: [ext4:dev 43/52] fs/ext4/inode.c:2211:6: warning: 'err' may be used uninitialized in this function
Date: Thu, 6 Jun 2013 10:57:11 -0400	[thread overview]
Message-ID: <20130606145711.GC5382@thunk.org> (raw)
In-Reply-To: <51aed48d.xK+2xHaWtYVlAT8d%fengguang.wu@intel.com>

On Wed, Jun 05, 2013 at 02:02:53PM +0800, kbuild test robot wrote:
> All warnings:
> 
>    fs/ext4/inode.c: In function 'ext4_da_writepages':
> >> fs/ext4/inode.c:2211:6: warning: 'err' may be used uninitialized in this function [-Wmaybe-uninitialized]
>    fs/ext4/inode.c:2154:6: note: 'err' was declared here

This looks like a false warning.  mpage_map_and_submit_extent() is
only capped when mpd.m_len is non-zero.  Hence we will execute the
budy of the while loop in that function at least once, which means err
will be initialized.

I'm curious what gcc version and/or -Wall flags triggered this
warning.  I'm using gcc 4.7.2 from Debian and it's not complaining.

I'm happy to initialize err to zero just to shut up the gcc warning,
but I'm curious how often it's triggered, since this looked pretty
trivial for gcc to be able to figure out on its own.

Thanks,

						- Ted

       reply	other threads:[~2013-06-06 14:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <51aed48d.xK+2xHaWtYVlAT8d%fengguang.wu@intel.com>
2013-06-06 14:57 ` Theodore Ts'o [this message]
2013-06-06 23:52   ` [ext4:dev 43/52] fs/ext4/inode.c:2211:6: warning: 'err' may be used uninitialized in this function Stephen Rothwell

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=20130606145711.GC5382@thunk.org \
    --to=tytso@mit.edu \
    --cc=fengguang.wu@intel.com \
    --cc=jack@suse.cz \
    --cc=kbuild-all@01.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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