This example:
static int
f (void)
{
int a = 0;
if (a > 0)
{
return a;
}
return 0;
}
produces incorrect warning:
t.c:7: warning 84: 'auto' variable 'a' may be used before initialization
t.c:7: warning 126: unreachable code
SDCC version:
SDCC : mcs51/gbz80/z80/ds390/pic16/pic14/TININative/ds400/hc08 2.9.7 #5646 (Jan 23 2010) (UNIX)
Borut
I forgot to specify the command line:
sdcc -S t.c
Borut
Warning 126 is correct, warning 84 is not.
This bug is present in both SDCC 2.9.0 and 2.9.7 #5973.
Fixed in SDCC revision 7128