karl@mote.umb.edu ("Karl Berry.") (01/23/89)
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