Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewsl!cbnewsk!cbnewsj!asd From: asd@cbnewsj.att.com (Adam S. Denton) Newsgroups: comp.lang.c Subject: Re: Wierd core dump on sparc-1 Message-ID: <1991Jan25.162034.12467@cbnewsj.att.com> Date: 25 Jan 91 16:20:34 GMT References: <1991Jan23.232300.3698@lavaca.uh.edu> <1991Jan24.061653.22785@tkou02.enet.dec.com> Organization: AT&T Bell Laboratories, Middletown, NJ Lines: 24 >>I've got a rather simple little C program that dumps core at >>the first "{" of main() (according to gdb and saber). >>Any hints as to what could be causing this? This can happen when you leave out a semicolon before main(): /* type definition section */ ... struct foo { int glorp; NERD *bar; } /* NOTE -- missing semicolon after `}' */ /* function definition section */ main() {...} Note that main() has now (inadvertantly) been declared to return a struct -- a Very Nasty Thing. The calling sequence may attempt to reserve space for the return value (a struct) but the startup code only expects to need space for an int which can cause trouble. Adam Denton asd@mtqua.att.com