lvc@tut.cis.ohio-state.edu (Lawrence V. Cipriani) (06/05/88)
Following up from comp.unix.wizards are amusing C Compiler bugs:
Then there was the bug where if you had a structure declaration right
before main and forget to end it with a ; the program would core dump
on exit:
struct blob {
int a, b, c;
} /* missing ; */
main(argc, argv) ...
This is also on old 3B compilers, fixed on newer ones.
--
Larry Cipriani, AT&T Network Systems and Ohio State University
Domain: lvc@tut.cis.ohio-state.edu
Path: ...!cbosgd!osu-cis!tut.cis.ohio-state.edu!lvc (strange but true)
karl@haddock.ISC.COM (Karl Heuer) (06/06/88)
In article <15085@tut.cis.ohio-state.edu> lvc@tut.cis.ohio-state.edu (Lawrence V. Cipriani) writes: >Following up from comp.unix.wizards are amusing C Compiler bugs: >Then there was the bug where if you had a structure declaration right before >main and forget to end it with a ; the program would core dump on exit: > struct blob { int a, b, c; } /* missing ; */ > main(argc, argv) ... Why should it be considered a "compiler bug" when a syntactically correct program containing a user bug dumps core? It seems to me that the appropriate "fix" is to make sure that lint complains about the mismatched declaration. Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint Followups to comp.lang.c.