C "optimization" (8 of 8)

chris at umcp-cs.UUCP chris at umcp-cs.UUCP
Thu Feb 23 05:51:02 AEST 1984

	From: ka at 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 at umcp-cs		ARPA:	chris.umcp-cs at CSNet-Relay

More information about the Comp.lang.c mailing list