Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!rutgers!att!alberta!teletron!andrew From: andrew@teletron.UUCP (Andrew Scott) Newsgroups: comp.lang.c Subject: Re: Structure pointer question Message-ID: <399@teletron.UUCP> Date: 7 Jul 88 15:52:50 GMT References: <361@teletron.uucp> <8074@brl-smoke.arpa> <4524@haddock.isc.com> <424@proxftl.UUCP> Organization: TeleTronic Communications Ltd., Edmonton, Alta. Lines: 20 In article <424@proxftl.UUCP>, bill@proxftl.UUCP (T. William Wells) writes: > In article <391@teletron.UUCP>, andrew@teletron.UUCP (Andrew Scott) writes: [ about an idea I had to use incomplete structure definitions as generic data structures ] > The correct solution is to have your library deal with void *. > If a raw void * bothers you, use typedef void *MESSAGE; and then > type everything as MESSAGE. Indeed, I have been informed that this is the only truly portable way of doing things. HOWEVER, I do not have a compiler that supports "void *" at the moment, and I cannot stand seeing lint all hot and bothered about casts to and from "char *". :-) Terrible reasons, I know, but it does look "cleaner" than using void * (to me, at least) and I think it *would* be portable if all pointers to structures had the same format. -- Andrew Scott andrew@teletron.uucp - or - {codas, ubc-cs, watmath, ..}!alberta!teletron!andrew