qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] move -Wno-error=uninitialized to configure


From: Stuart Brady
Subject: Re: [Qemu-devel] [PATCH] move -Wno-error=uninitialized to configure
Date: Tue, 30 Jun 2009 16:22:35 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]