Structure pointer question
Andrew Scott
andrew at teletron.UUCP
Fri Jul 8 01:52:50 AEST 1988
In article <424 at proxftl.UUCP>, bill at proxftl.UUCP (T. William Wells) writes:
> In article <391 at teletron.UUCP>, andrew at 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 at teletron.uucp - or -
{codas, ubc-cs, watmath, ..}!alberta!teletron!andrew
More information about the Comp.lang.c
mailing list