Bug: Incorrect warning

Brad Proctor fredlie@sprynet.com
Mon Jun 7 02:02:00 GMT 1999


Hi,

I think I've found a bug in egcs-2.91.66.  It reports an incorrect
warning and only when using -O3.  Here's what I've done:

$ gcc -c -Wall lex.i -o lex.o
$ gcc -O2 -c -Wall lex.i -o lex.o
$ gcc -O3 -c -Wall lex.i -o lex.o
lex.c: In function `yylex':
lex.c:86: warning: `ptr' might be used uninitialized in this function

It shouldn't be reporting the warning, the code in lex.i is similar to
this:

char *ptr;

switch(c)
{
   case '\'':           /* Only place 'ptr' is used */
      ptr = string;
      ...
}

Brad Proctor
lex.i.gz



More information about the Gcc-bugs mailing list