hugh@redvax.ai.mit.edu (D. Hugh Redelmeier) (05/19/89)
As the following script demonstrates, gcc reports an error where there is none. My system is a Sun 3/60 running SunOS3.5.2. I configured gcc by executing "config sun3". Script started on Thu May 18 13:25:24 1989 $ gcc -v -S MyBug2.c gcc version 1.35 /usr/local/lib/gcc-cpp -v -undef -D__GNUC__ -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 MyBug2.c /tmp/cca04362.cpp GNU CPP version 1.35 /usr/local/lib/gcc-cc1 /tmp/cca04362.cpp -quiet -dumpbase MyBug2.c -version -o MyBug2.s GNU C version 1.35 (68k, MIT syntax) compiled by GNU C version 1.35. MyBug2.c: In function main: MyBug2.c:14: invalid use of undefined type `struct struct_b' $ cat MyBug2.c struct struct_a { const struct struct_b *b_ptr; } a; struct struct_b { int contents; }; extern const struct struct_b b_tab[]; void main() { a.b_ptr = &b_tab[0]; } $ exit script done on Thu May 18 13:26:36 1989 Note that the error message goes away if either "const" keyword is deleted.