From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26143 invoked by alias); 22 May 2008 11:23:58 -0000 Received: (qmail 25226 invoked by uid 48); 22 May 2008 11:23:15 -0000 Date: Thu, 22 May 2008 11:23:00 -0000 Message-ID: <20080522112315.25225.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/msg01696.txt.bz2 ------- Comment #5 from vincent at vinc17 dot org 2008-05-22 11:23 ------- BTW, the i = i trick, which is guaranteed to be valid and no-op only *after* i has been initialized doesn't avoid the warning in such a case. I don't know if this would be a good feature (the main drawback I can see would be to miss warnings when this is a result of macro expansion). For instance: #include int foo (int x) { int y; assert (x == 0 || x == 1); if (x == 0) y = 1; else if (x == 1) y = 2; y = y; /* to tell the compiler that y has been initialized */ return y; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36296