[Bug c/41441] New: failure to warn about uninitialized induction var
regehr at cs dot utah dot edu
gcc-bugzilla@gcc.gnu.org
Wed Sep 23 02:40:00 GMT 2009
In foo() below, I'd expect gcc to emit a warning about use of i without
initialization, but this does not happen.
regehr@john-home:~$ current-gcc -O -Wall uninit.c -o uninit
regehr@john-home:~$ current-gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/home/regehr/z/tmp/gcc-r151949-install
--program-prefix=r151949- --enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20090921 (experimental) (GCC)
regehr@john-home:~$ cat uninit.c
#include <stdio.h>
void foo (void) {
int i;
for (; i<10; i=11) {
}
}
int main (void)
{
foo();
return 0;
}
--
Summary: failure to warn about uninitialized induction var
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: regehr at cs dot utah dot edu
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41441
More information about the Gcc-bugs
mailing list