From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18454 invoked by alias); 5 Jan 2013 12:16:04 -0000 Received: (qmail 18330 invoked by uid 48); 5 Jan 2013 12:15:36 -0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/55873] Missed trivial uninitialized use warning Date: Sat, 05 Jan 2013 12:16:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: 2013-01/txt/msg00363.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D55873 --- Comment #3 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez 2013-01-05 12:15:35 UTC --- PR18501, the most frequently reported Wuninitialized bug. Of course, it is possible to fix it. Clang does warn: pr18501.c:5:7: warning: variable 'res' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (c) ^ pr18501.c:7:10: note: uninitialized use occurs here return res; ^~~ pr18501.c:5:3: note: remove the 'if' if its condition is always true if (c) ^~~~~~ pr18501.c:4:10: note: initialize the variable 'res' to silence this warning int res; ^ =3D 0 1 warning generated. It is just that it probably needs some serious amount of work.