From: Stuart Brady <sdbrady@ntlworld.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] move -Wno-error=uninitialized to configure
Date: Tue, 30 Jun 2009 16:22:35 +0100 [thread overview]
Message-ID: <20090630152235.GA23994@miranda.arrow> (raw)
In-Reply-To: <20090630125849.GA10413@redhat.com>
On Tue, Jun 30, 2009 at 03:58:49PM +0300, Michael S. Tsirkin wrote:
> On Tue, Jun 30, 2009 at 01:44:31PM +0100, Paul Brook wrote:
> > The whole point of -Werror is that it forces us to keep the code clean.
> > Having to mentally filter out false positives just doesn't work. Once you have
> > routinely expected warnings then people stop checking for new ones.
>
> That's what -Wno-error=uninitialized does: makes the filtering
> automatically so you don't need to filter it mentally.
Right, but not all versions of GCC that support '-Werror' support
'-Wno-error=...'. As I tried to hint at previously, the only sensible
way to deal with this is to use '-Werror=...' to be specific about the
types of checking that you want, so that you can avoid checks that
produce false positives, and only enable the checking on versions of GCC
that support it. Otherwise, future versions of GCC could produce all
sorts of false positives that you have no control over. '-Werror=...'
doesn't fix that entirely, but at least it's a start.
I've already seen several 'fixes' to QEMU to suppress false positives.
For some strange reason people always pick the magic value '0' when
'shutting GCC up'. *sigh* At the very least, *please please please*
consider something like Linux's uninitialized_var() macro for this.
(BTW, recommended reading: http://lwn.net/Articles/331593/)
Cheers,
--
Stuart Brady
next prev parent reply other threads:[~2009-06-30 15:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-30 11:39 [Qemu-devel] [PATCH] move -Wno-error=uninitialized to configure Michael S. Tsirkin
2009-06-30 12:07 ` Paul Brook
2009-06-30 12:12 ` Michael S. Tsirkin
2009-06-30 12:16 ` Michael S. Tsirkin
2009-06-30 12:44 ` Paul Brook
2009-06-30 12:58 ` Michael S. Tsirkin
2009-06-30 15:22 ` Stuart Brady [this message]
2009-06-30 12:30 ` Avi Kivity
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=20090630152235.GA23994@miranda.arrow \
--to=sdbrady@ntlworld.com \
--cc=qemu-devel@nongnu.org \
/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).