pardo@JUNE.CS.WASHINGTON.EDU (10/02/89)
GCC: 1.36
MACHINE: VAX/Ultrix 3.0
Configured w/ `config.gcc'
The following code fragment causes `cc' and `CC' (AT&T C++) to issue a
warning message about unreached initializers. `gcc -Wall' does not.
`gcc' behaves correctly but it would be nice if it issued a warning.
foo.c:
/* From Richard O'Keefe (ok@cs.mu.oz.au), comp.std.c */
main(argc) int argc;
{
switch (argc) {
int i = 1;
double x = 2.0;
case 1:
case 2:
exit(i);
default:
exit(!!x);
}
}
gcc -v -Wall foo.c
gcc version 1.36
/uns/usr/local/lib/gcc-cpp -v -undef -D__GNUC__ -Dvax -Dunix -D__vax__ -D__unix__ -Wall foo.c /usr/tmp/cca08978.cpp
GNU CPP version 1.36
/uns/usr/local/lib/gcc-cc1 /usr/tmp/cca08978.cpp -quiet -dumpbase foo.c -Wall -version -o /usr/tmp/cca08978.s
GNU C version 1.36 (vax) compiled by GNU C version 1.36.
default target switches: -munix
foo.c: In function main:
foo.c:3: warning: return-type defaults to `int'
foo.c:10: warning: implicit declaration of function `exit'
foo.c:14: warning: control reaches end of non-void function
as -o foo.o /usr/tmp/cca08978.s
ld /lib/crt0.o foo.o /uns/usr/local/lib/gcc-gnulib -lc
;-D on ( Kernel and GNUser priv ) Pardo