From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MLcjY-0006lp-8J for qemu-devel@nongnu.org; Tue, 30 Jun 2009 08:46:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MLcjS-0006YB-R0 for qemu-devel@nongnu.org; Tue, 30 Jun 2009 08:46:47 -0400 Received: from [199.232.76.173] (port=41224 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MLcjS-0006Xk-KA for qemu-devel@nongnu.org; Tue, 30 Jun 2009 08:46:42 -0400 Received: from mx20.gnu.org ([199.232.41.8]:19023) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MLcjS-0002fo-BG for qemu-devel@nongnu.org; Tue, 30 Jun 2009 08:46:42 -0400 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MLcjR-0007FH-Ei for qemu-devel@nongnu.org; Tue, 30 Jun 2009 08:46:41 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH] move -Wno-error=uninitialized to configure Date: Tue, 30 Jun 2009 13:44:31 +0100 References: <20090630113949.GA32364@redhat.com> <20090630121240.GA1227@redhat.com> <20090630121613.GB1227@redhat.com> In-Reply-To: <20090630121613.GB1227@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200906301346.38466.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Laurent Desnogues , Anthony Liguori , "Michael S. Tsirkin" On Tuesday 30 June 2009, Michael S. Tsirkin wrote: > On Tue, Jun 30, 2009 at 03:12:40PM +0300, Michael S. Tsirkin wrote: > > On Tue, Jun 30, 2009 at 01:07:34PM +0100, Paul Brook wrote: > > > On Tuesday 30 June 2009, Michael S. Tsirkin wrote: > > > > Move -Wno-error=uninitialized out of rules.mak and into configure. > > > > Only use it if supported by compiler. > > > > > > Why? Shouldn't we be fixing the uninitialized variables? > > > > > > Paul > > > > gcc's algorithm for detecting uninitialized variables is > > famously unreliable. Just scattering '= 0' around the code > > masks the warning but hides the fact that application logic > > might still be broken. > > To clarify: what's broken is that gcc has false positives in the logic. > And if you work around this by adding initialization where it's not > really required, you confuse other tools that would otherwise have a > chance to detect an error. In that case should we be using -Wno-uninitialized? 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. Paul