From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21552 invoked by alias); 22 May 2008 08:34:46 -0000 Received: (qmail 21451 invoked by uid 48); 22 May 2008 08:34:03 -0000 Date: Thu, 22 May 2008 08:34:00 -0000 Message-ID: <20080522083403.21450.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/36296] wrong warning about potential uninitialized variable In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "vincent at vinc17 dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-05/txt/msg01688.txt.bz2 ------- Comment #2 from vincent at vinc17 dot org 2008-05-22 08:34 ------- The severity should probably be changed to enhancement because gcc behaves as documented (well, almost). What can be done IMHO is: 1. Split the -Wuninitialized into two different warnings: one for which gcc knows that the variable is uninitialized and one for which it cannot decide. -Wuninitialized currently does both. 2. Provide an extension so that the user can tell gcc not to emit a warning for some particular variable. This would sometimes be better than adding a dummy initialization (which has its own drawbacks). In the mean time, make the documentation better concerning -Wuninitialized: change the first sentence "Warn if an automatic variable is used without first being initialized [...]" to "Warn if an automatic variable *may be* used without first being initialized" (though the behavior is detailed later). -- vincent at vinc17 dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vincent at vinc17 dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36296