Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754578AbYJBJC7 (ORCPT ); Thu, 2 Oct 2008 05:02:59 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753014AbYJBJCw (ORCPT ); Thu, 2 Oct 2008 05:02:52 -0400 Received: from mx3.mail.elte.hu ([157.181.1.138]:43786 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752875AbYJBJCv (ORCPT ); Thu, 2 Oct 2008 05:02:51 -0400 Date: Thu, 2 Oct 2008 11:02:46 +0200 From: Ingo Molnar To: Alan Cox Cc: Steven Noonan , linux-kernel@vger.kernel.org Subject: Re: [PATCH] drivers/serial/8250.c: 'i' may be used uninitialized Message-ID: <20081002090246.GD3550@elte.hu> References: <1222850827-30522-1-git-send-email-steven@uplinklabs.net> <20081001223645.23ad0e5e@lxorguk.ukuu.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081001223645.23ad0e5e@lxorguk.ukuu.org.uk> User-Agent: Mutt/1.5.18 (2008-05-17) X-ELTE-VirusStatus: clean X-ELTE-SpamScore: -1.5 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-1.5 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.2.3 -1.5 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1191 Lines: 28 * Alan Cox wrote: > On Wed, 1 Oct 2008 01:47:07 -0700 > Steven Noonan wrote: > > > serial_unlink_irq_chain() does not initialize iterator 'i', and that is > > correct logically because it is always initialized, either in the > > hlist_for_each or in the conditional immediately after (which fires if > > hlist_for_each comes up empty-handed). GCC does not realize this > > connection and emits a false warning. Annotate it with uninitialized_var(). > > > > Signed-off-by: Steven Noonan > > Ok definitive NAK. gcc 4.3.0 can work this out and doesn't produce a > warning. Thanks for sending the patch though (and to the gcc folks for > rendering it unnecessary) thanks for sorting it out! A CONFIG_CC_DISABLE_WARNING_ANNOTATIONS=y might be useful as well, which could be used periodically (by gcc folks) to check which warnings are hidden by annotations? Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/