This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/44042] New: [4.4, 4.5,4.6 Regression] Missing warning for unitialized varaible in switch statement
- From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 May 2010 14:58:19 -0000
- Subject: [Bug c/44042] New: [4.4, 4.5,4.6 Regression] Missing warning for unitialized varaible in switch statement
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
ig25@linux-fd1f:/tmp> cat haha.c
int f(n)
{
int r;
switch(n)
{
case 1:
r = 3;
}
return r;
}
ig25@linux-fd1f:/tmp> gcc -O3 -c -Wall haha.c
ig25@linux-fd1f:/tmp> gcc -v
Es werden eingebaute Spezifikationen verwendet.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/ig25/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Ziel: x86_64-unknown-linux-gnu
Konfiguriert mit: ../fortran-dev/configure --prefix=/home/ig25
--enable-languages=all,ada --with-mpc=/usr/local
Thread-Modell: posix
gcc-Version 4.6.0 20100430 (experimental) (GCC)
ig25@linux-fd1f:/tmp> gcc-3.3 -O3 -c -Wall haha.c
haha.c: In function `f':
haha.c:3: warning: `r' might be used uninitialized in this function
Also fails for 4.4 and 4.5.
--
Summary: [4.4, 4.5,4.6 Regression] Missing warning for
unitialized varaible in switch statement
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tkoenig at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44042