* Re: [ext4:dev 43/52] fs/ext4/inode.c:2211:6: warning: 'err' may be used uninitialized in this function
[not found] <51aed48d.xK+2xHaWtYVlAT8d%fengguang.wu@intel.com>
@ 2013-06-06 14:57 ` Theodore Ts'o
2013-06-06 23:52 ` Stephen Rothwell
0 siblings, 1 reply; 2+ messages in thread
From: Theodore Ts'o @ 2013-06-06 14:57 UTC (permalink / raw)
To: kbuild test robot; +Cc: Jan Kara, kbuild-all, sfr, linux-ext4
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [ext4:dev 43/52] fs/ext4/inode.c:2211:6: warning: 'err' may be used uninitialized in this function
2013-06-06 14:57 ` [ext4:dev 43/52] fs/ext4/inode.c:2211:6: warning: 'err' may be used uninitialized in this function Theodore Ts'o
@ 2013-06-06 23:52 ` Stephen Rothwell
0 siblings, 0 replies; 2+ messages in thread
From: Stephen Rothwell @ 2013-06-06 23:52 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: kbuild test robot, Jan Kara, kbuild-all, linux-ext4
[-- Attachment #1: Type: text/plain, Size: 1233 bytes --]
HI Ted,
On Thu, 6 Jun 2013 10:57:11 -0400 Theodore Ts'o <tytso@mit.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@canb.auug.org.au
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-06-06 23:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <51aed48d.xK+2xHaWtYVlAT8d%fengguang.wu@intel.com>
2013-06-06 14:57 ` [ext4:dev 43/52] fs/ext4/inode.c:2211:6: warning: 'err' may be used uninitialized in this function Theodore Ts'o
2013-06-06 23:52 ` Stephen Rothwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox