From: Paul Bolle <pebolle@tiscali.nl>
To: Christoph Hellwig <hch@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>, Sam Ravnborg <sam@ravnborg.org>,
Boaz Harrosh <openosd@gmail.com>,
pramod.gurav.etc@gmail.com, viro@zeniv.linux.org.uk,
Jason Cooper <jason@lakedaemon.net>,
Markus Mayer <markus.mayer@linaro.org>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs/direct-io.c: Fix compilation warning for uninitialized variables
Date: Wed, 16 Jul 2014 20:42:04 +0200 [thread overview]
Message-ID: <1405536124.4357.17.camel@x41> (raw)
In-Reply-To: <20140716175803.GA3631@infradead.org>
[Added Borislav and Sam to cc.]
Christoph Hellwig schreef op wo 16-07-2014 om 10:58 [-0700]:
> On Wed, Jul 16, 2014 at 08:08:41PM +0300, Boaz Harrosh wrote:
> > This is the wrong fix. GCC is wrong here. As shown by Paul Bolle if
> > you move the from / to set from dio_get_page() to here the warning goes away.
> >
> > The minimal fix must use uninitialized_var() in this case. See patch below
> >
> > But I think the proper fix Is the one Paul Bolle <pebolle@tiscali.nl> sent (above)
>
> I don't think the initialization is wrong. The fix of moving the code
> defintively looks nicer,
Whether that was Jason's idea or mine doesn't matter much - though I do
think Boaz quoted part of my fix, but it was just a _draft_.
Anyhow, after all that I got involved in a short thread;
https://lkml.org/lkml/2014/7/8/168 is my contribution. My point is,
basically, that the false positives of -Wmaybe-uninitialized are a "code
smell". They tend to disappear if one reorganizes the code a bit.
Borislav disagrees quite strongly. I didn't really bother with keeping
that thread alive because I feared we'd mainly see more colorful
language.
> while I think uninitialized_var is horrible wart
Agree totally.
> that won't get anywhere near my code.
>
> Either way we should merge one of those fixes ASAP..
I'd like my builds to be warning free too. And it would be nice to know
whether there's consensus on how to deal with the false positives of
-Wmaybe-uninitialized that make it into mainline.
Paul Bolle
next prev parent reply other threads:[~2014-07-16 18:42 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-04 5:43 [PATCH] fs/direct-io.c: Fix compilation warning for uninitialized variables pramod.gurav.etc
2014-07-13 11:50 ` Christoph Hellwig
2014-07-14 7:04 ` pramod gurav
2014-07-16 17:08 ` Boaz Harrosh
2014-07-16 17:56 ` Jason Cooper
2014-07-16 17:58 ` Christoph Hellwig
2014-07-16 18:42 ` Paul Bolle [this message]
2014-07-17 9:37 ` direct-io: squelch maybe-uninitialized warning in do_direct_IO() Boaz Harrosh
2014-07-17 9:40 ` Boaz Harrosh
2014-07-17 9:54 ` Paul Bolle
2014-07-17 9:48 ` Paul Bolle
2014-07-17 11:00 ` Boaz Harrosh
2014-07-17 11:11 ` [PATCH v2] " Boaz Harrosh
2014-07-17 11:29 ` Paul Bolle
2014-07-20 9:09 ` [PATCH v3] direct-io: fix uninitialized " Boaz Harrosh
2014-07-21 11:36 ` Christoph Hellwig
2014-07-22 9:03 ` Boaz Harrosh
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=1405536124.4357.17.camel@x41 \
--to=pebolle@tiscali.nl \
--cc=bp@alien8.de \
--cc=hch@infradead.org \
--cc=jason@lakedaemon.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=markus.mayer@linaro.org \
--cc=openosd@gmail.com \
--cc=pramod.gurav.etc@gmail.com \
--cc=sam@ravnborg.org \
--cc=viro@zeniv.linux.org.uk \
/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).