Thread View: gnu.gcc.bug
1 messages
1 total messages
Started by Erik Talvola
Fri, 31 Jul 1992 16:54
Spurious warning in gcc-2.2.2
Author: Erik Talvola
Date: Fri, 31 Jul 1992 16:54
Date: Fri, 31 Jul 1992 16:54
39 lines
2155 bytes
2155 bytes
The following program:
int test1()
{
return;
}
generates 2 warnings, as shown below. The warning about the 'return' with
no value is correct, but the one about control reaching the end of a
non-void function seems bogus. As you can see, gcc-1.40 didn't do this.
Script started on Fri Jul 31 09:43:48 1992
qin% gcc -v -c -Wall gcctest1.c
gcc version 1.40
/usr/sww/lib/gcc-cpp -v -undef -D__GNUC__ -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -Wall gcctest1.c /usr/tmp/cca13219.cpp
GNU CPP version 1.40
/usr/sww/lib/gcc-cc1 /usr/tmp/cca13219.cpp -quiet -dumpbase gcctest1.c -Wall -version -o /usr/tmp/cca13219.s
GNU C version 1.40 (sparc) compiled by GNU C version 1.40.
default target switches: -mfpu -mepilogue
gcctest1.c: In function test1:
gcctest1.c:3: warning: `return' with no value, in function returning non-void
/usr/sww/lib/gcc-as -o gcctest1.o /usr/tmp/cca13219.s
qin% gcc-2.2.2 -v -c -Wall gcctest1.c
Reading specs from /usr/sww/lib/gcc-lib/sun4/2.2.2/specs
gcc version 2.2.2
/usr/sww/lib/gcc-lib/sun4/2.2.2/cpp -lang-c -v -undef -D__GNUC__=2 -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix -Wall gcctest1.c /usr/tmp/cca13223.i
GNU CPP version 2.2.2 (sparc)
/usr/sww/lib/gcc-lib/sun4/2.2.2/cc1 /usr/tmp/cca13223.i -quiet -dumpbase gcctest1.c -Wall -version -o /usr/tmp/cca13223.s
GNU C version 2.2.2 (sparc) compiled by GNU C version 2.2.2.
gcctest1.c: In function `test1':
gcctest1.c:3: warning: `return' with no value, in function returning non-void
gcctest1.c:4: warning: control reaches end of non-void function
as -o gcctest1.o /usr/tmp/cca13223.s
qin% exit
qin%
script done on Fri Jul 31 09:44:56 1992
-----------------------------------------------
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads