Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!gatech!mcnc!rti!xyzzy!agarn!throopw From: throopw@agarn.dg.com (Wayne A. Throop) Newsgroups: comp.lang.c Subject: Re: incomplete types (was: Recursive #includes) Message-ID: <4148@xyzzy.UUCP> Date: 15 Mar 89 18:51:29 GMT References: <570@marob.MASA.COM> <9727@smoke.BRL.MIL> <964@philmds.UUCP> <3804@xyzzy.UUCP> <7488@june.cs.washington.edu> <9804@smoke.BRL.MIL> <1567@ubu.warwick.UUCP> <9842@smoke.BRL.MIL> <976@philmds.UUCP> Sender: usenet@xyzzy.UUCP Lines: 30 > leo@philmds.UUCP (Leo de Wit) >| gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) >|There is nothing inherently "bad" about incomplete types, especially >|incomplete structure declarations. In fact they are essential for >|declaring structures that contain pointers to each other. > How essential that is? Consider: > struct egg { > struct hen { > struct egg *eggp; > } *henp; > }; Ok. I've considered it. The type "struct egg" is incomplete at the point it is used, namely in the line struct egg *eggp; So I'd say Leo hasn't come up with an example where mutually referential structures can be defined without resorting to incomplete types. As far as I can see, it's still essential. -- All the system's paths must be topologically and circularly interrelated for conceptually definitive, locally transformable, polyhedronal understanding to be attained in our spontaneous -- ergo, most economical -- geodesiccally structured thoughts. --- R. Buckminster Fuller -- Wayne Throop !mcnc!rti!xyzzy!throopw