Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!sm.unisys.com!ism780c!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: Recursive #includes Keywords: recursive includes, modularity Message-ID: <11959@haddock.ima.isc.com> Date: 6 Mar 89 19:56:40 GMT References: <570@marob.MASA.COM> <9727@smoke.BRL.MIL> <964@philmds.UUCP> <3804@xyzzy.UUCP> <7488@june.cs.washington.edu> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 13 In article <7488@june.cs.washington.edu> ka@june.cs.washington.edu (Kenneth Almquist) writes: >I've been told that incomplete types cannot be used in function >prototypes. For example, > void f(struct s *); > struct s { ... }; > void f(struct s *p) { ... } >is illegal ... Yes it is illegal, but due to a scoping problem, not a restriction against incomplete types. Adding the empty declaration `struct s;' at the top should cause it to become legal. (I just tested this with gcc.) Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint