Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site umcp-cs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!harpo!seismo!rlgvax!cvl!umcp-cs!chris From: chris@umcp-cs.UUCP Newsgroups: net.lang.c Subject: Re: C "optimization" (8 of 8) Message-ID: <5363@umcp-cs.UUCP> Date: Wed, 22-Feb-84 14:51:02 EST Article-I.D.: umcp-cs.5363 Posted: Wed Feb 22 14:51:02 1984 Date-Received: Thu, 23-Feb-84 05:38:03 EST References: <210@mi-cec.UUCP> <317@hou3c.UUCP> Organization: Univ. of Maryland, Computer Science Dept. Lines: 19 From: ka@hou3c.UUCP (Kenneth Almquist) This example also shows what is really a bug in the C compiler. After executing the assignment, it (unnecessarily) takes the value of *(a->p->p).... the C code was: ... typedef struct dp *DP; struct dp { int d; DP p; } test(a) DP a; { ... Nope. It's a bug in the C code. Look closely at the "struct" declaration: no trailing semicolon. That makes "test" a structure-valued function. I missed that the first time too. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci UUCP: {seismo,allegra,brl-bmd}!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris.umcp-cs@CSNet-Relay