C inconsistency?
Jon H. LaBadie
jon at jonlab.UUCP
Wed Apr 12 16:33:51 AEST 1989
Rajiv's question, and Farrell's response recall painful memories of a
similar "bug".
In article <15 at masscomp.UUCP>, ftw at masscomp.UUCP (Farrell Woods) writes:
> In article <1989Mar30.192903.28426 at gpu.utcs.toronto.edu> sarathy at 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!
More information about the Comp.lang.c
mailing list