Re: [ext4:dev 43/52] fs/ext4/inode.c:2211:6: warning: 'err' may be used uninitialized in this function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



HI Ted,

On Thu, 6 Jun 2013 10:57:11 -0400 Theodore Ts'o <tytso@xxxxxxx> wrote:
>
> 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.

Yeah, I guessed that was the case.

> 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.

$ gcc --version
gcc (Debian 4.7.3-4) 4.7.3

I also saw it with gcc 4.8.0.

> 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.

gcc may not be as clever as you hope :-)

-- 
Cheers,
Stephen Rothwell                    sfr@xxxxxxxxxxxxxxxx

Attachment: pgp6E4w2v6tdx.pgp
Description: PGP signature


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux