jim@meiko.co.uk (05/25/89)
From : James Cownie
Meiko Limited
Aztec West
Bristol
GREAT BRITAIN
The following function gives an incorrect warning
gccbug.c: In function localise:
gccbug.c: warning: control reaches end of non-void function
when compiled with gcc 1.34 on a SUN under SUNOS 3.5 by the command
gcc -Wall gccbug.c
interestingly the warning is NOT produced if optimisation is enabled
gcc -O -Wall gccbug.c
I know this is NOT a serious bug, but it is slightly irritating !
Our gcc was built in the default manner for a SUN3.
Good luck James Cownie
int localise(int nd)
{
if (nd == 0)
return nd;
else
{
if (nd == 2)
{
if (nd == 3)
return nd + 1;
else
return nd + 2;
}
else
return nd + 3;
}
}