This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/44042] New: [4.4, 4.5,4.6 Regression] Missing warning for unitialized varaible in switch statement


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]