lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 7 Jun 2013 09:52:23 +1000
From:	Stephen Rothwell <sfr@...b.auug.org.au>
To:	Theodore Ts'o <tytso@....edu>
Cc:	kbuild test robot <fengguang.wu@...el.com>,
	Jan Kara <jack@...e.cz>, kbuild-all@...org,
	linux-ext4@...r.kernel.org
Subject: Re: [ext4:dev 43/52] fs/ext4/inode.c:2211:6: warning: 'err' may be
 used uninitialized in this function

HI Ted,

On Thu, 6 Jun 2013 10:57:11 -0400 Theodore Ts'o <tytso@....edu> 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@...b.auug.org.au

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists