Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!rochester!rutgers!att!ulysses!andante!princeton!jonlab!jon From: jon@jonlab.UUCP (Jon H. LaBadie) Newsgroups: comp.lang.c Subject: Re: C inconsistency? Summary: Oh the memory still hurts Message-ID: <772@jonlab.UUCP> Date: 12 Apr 89 06:33:51 GMT References: <1989Mar30.192903.28426@gpu.utcs.toronto.edu> <15@masscomp.UUCP> Organization: 4455 Province Line Rd., Princeton, NJ 08540 Lines: 47 Rajiv's question, and Farrell's response recall painful memories of a similar "bug". In article <15@masscomp.UUCP>, ftw@masscomp.UUCP (Farrell Woods) writes: > In article <1989Mar30.192903.28426@gpu.utcs.toronto.edu> sarathy@gpu.utcs.UUCP (Rajiv Sarathy) writes: > > > struct element { > > char *key; > > int level; > > struct element **fpointer; > > } > > struct element *head[LEVELCAP]; /* array of pointers to struct */ > > Indeed, you're missing a semi-colon. (after the closing brace j.l.) I developed some code for a client with the beginning of the program organized like this: struct foo { ... ... } /* ** ** long ( > 1 page ) preamble of comments ** */ main(...) { ... } On my development machine, the code worked fine and I delivered it and recompiled it on the clients system. The latter had a different cpu. It seemed to run fine ... except that it core dumped when it exited. Ran fine until it exited, just that d****d core file each time you used it. Try to convince someone paying the bill "It works fine, just dumps core each time you use it." Yeah, sure. Took me quite a while to realize main was "trying" to return a 68 byte structure, not an int. Whatever was receiving the return value of main was surely surprised!