Path: utzoo!attcan!uunet!husc6!bloom-beacon!tut.cis.ohio-state.edu!osu-cis!att!alberta!teletron!andrew From: andrew@teletron.UUCP (Andrew Scott) Newsgroups: comp.lang.c Subject: Re: Structure pointer question Message-ID: <391@teletron.UUCP> Date: 29 Jun 88 19:01:30 GMT References: <361@teletron.uucp> <8074@brl-smoke.arpa> <4524@haddock.isc.com> <389@proxftl.UUCP> Organization: TeleTronic Communications Ltd., Edmonton, Alta. Lines: 28 In article <389@proxftl.UUCP>, bill@proxftl.UUCP (T. William Wells) writes: > Having reread the new C standard just to see what it says about > incomplete types relating to structure pointers, here is what I > come up with. > > Nothing in the standard seems to require completing the type > unless the pointer is actually dereferenced. Now that my original question has been answered, I have another: Suppose that I've constrcuted a library of functions that operate on a "generic" data structure called 'struct message'. This structure is an incomplete type; the library functions merely deal with pointers to this structure but not with the fields within. It is now permissible to use this library with different declarations of 'struct message' *in the same program*? I'm not planning on converting between multiple kinds of "messages", I just want to have multiple modules in the program able to use the previously constructed library with data structures applicable to (and used in) only one module. My initial guess is that it would work, given that C requires all structure pointers to have the same format and provided that I compile the different modules of the program seperately (so that the compiler doesn't see the multiple declarations). -- Andrew Scott andrew@teletron.uucp - or - {codas, ubc-cs, watmath, ..}!alberta!teletron!andrew