Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!JUNE.CS.WASHINGTON.EDU!pardo From: pardo@JUNE.CS.WASHINGTON.EDU Newsgroups: gnu.gcc.bug Subject: ``Quality of implementation'', -Wall Message-ID: <8910021631.AA09379@june.cs.washington.edu> Date: 2 Oct 89 16:31:46 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 39 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