Path: utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bbn!mailrus!tut.cis.ohio-state.edu!mote.umb.edu!karl From: karl@mote.umb.edu ("Karl Berry.") Newsgroups: gnu.gcc.bug Subject: spurious warnings Message-ID: <8901222213.AA07527@mote.cs> Date: 22 Jan 89 22:13:15 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 30 This is gcc 1.32 on a Sun 3 running 3.4. When variables are misdeclared, as in the following program, attempts to use them seem to often result in `warning: statement with no effect'. I have no trouble believing that, but I've already been told about the error, and don't need to see every place I used the variable! Here is the program: void main() { char n[bad_size]; int i; n[++i] = 'x'; } and here is the compilation: gcc version 1.32 /usr/local/gnu/lib/gcc-cpp -v -undef -D__GNUC__ -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -Wall -D__HAVE_68881__ -Dmc68020 /tmp/bad.c /tmp/cca07519.cpp GNU CPP version 1.32 /usr/local/gnu/lib/gcc-cc1 /tmp/cca07519.cpp -quiet -dumpbase /tmp/bad.c -Wall -version -o /tmp/cca07519.s GNU C version 1.32 (68k, MIT syntax) compiled by GNU C version 1.32. /tmp/bad.c: In function main: /tmp/bad.c:4: undeclared variable `bad_size' (first use here) /tmp/bad.c:7: warning: statement with no effect