This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/30856] New: Missing "warning: '$FOO' may be used uninitialized in this function" in trivial case
- From: "christoph dot mallon at gmx dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Feb 2007 09:24:09 -0000
- Subject: [Bug c/30856] New: Missing "warning: '$FOO' may be used uninitialized in this function" in trivial case
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
int f(int x)
{
int y;
if (x == 42) y = 23;
return y;
}
This simple function results in no warning about the possibly uninitialized
local variable 'y' when using the following compiler versions (compiler flags:
-O -Wall):
GCC 4.1.2 20070205
GCC 4.2.0 20070214
GCC 4.3.0 20070209
The warning is correctly reported by GCC 2.95.3, GCC 3.4.6 20060305 and GCC
4.0.4.
--
Summary: Missing "warning: '$FOO' may be used uninitialized in
this function" in trivial case
Product: gcc
Version: 4.1.2
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: christoph dot mallon at gmx dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30856