From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MLfAb-0005gV-JP for qemu-devel@nongnu.org; Tue, 30 Jun 2009 11:22:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MLfAW-0005dd-AM for qemu-devel@nongnu.org; Tue, 30 Jun 2009 11:22:53 -0400 Received: from [199.232.76.173] (port=60110 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MLfAW-0005dO-3v for qemu-devel@nongnu.org; Tue, 30 Jun 2009 11:22:48 -0400 Received: from mtaout03-winn.ispmail.ntl.com ([81.103.221.49]:62913) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MLfAV-0008KB-MC for qemu-devel@nongnu.org; Tue, 30 Jun 2009 11:22:48 -0400 Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20090630152238.HLBQ5579.mtaout03-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com> for ; Tue, 30 Jun 2009 16:22:38 +0100 Received: from miranda.arrow ([213.107.24.213]) by aamtaout01-winn.ispmail.ntl.com (InterMail vG.2.02.00.01 201-2161-120-102-20060912) with ESMTP id <20090630152238.TXJE13254.aamtaout01-winn.ispmail.ntl.com@miranda.arrow> for ; Tue, 30 Jun 2009 16:22:38 +0100 Received: from sdb by miranda.arrow with local (Exim 4.63) (envelope-from ) id 1MLfAJ-0006GF-KB for qemu-devel@nongnu.org; Tue, 30 Jun 2009 16:22:35 +0100 Date: Tue, 30 Jun 2009 16:22:35 +0100 From: Stuart Brady Subject: Re: [Qemu-devel] [PATCH] move -Wno-error=uninitialized to configure Message-ID: <20090630152235.GA23994@miranda.arrow> References: <20090630113949.GA32364@redhat.com> <20090630121240.GA1227@redhat.com> <20090630121613.GB1227@redhat.com> <200906301346.38466.paul@codesourcery.com> <20090630125849.GA10413@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090630125849.GA10413@redhat.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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