Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!decvax!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: %p and different pointer representations Message-ID: <11915@haddock.ima.isc.com> Date: 1 Mar 89 19:14:51 GMT References: <9382@bloom-beacon.MIT.EDU> <234@mstan.Morgan.COM> <16112@mimsy.UUCP> <592@jhereg.Jhereg.MN.ORG> <16120@mimsy.UUCP> <597@jhereg.Jhereg.MN.ORG> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 12 In article <597@jhereg.Jhereg.MN.ORG> mark@jhereg.MN.ORG (Mark H. Colburn) writes: >What it means, is that there is no portable way to pass an arbitrary pointer >to a function or store one in a data structure. Any function-pointer object may be cast to any other function-pointer type and back without change; hence any such type (e.g. `void (*)(void)') may be used as a generic function-pointer type. Therefore, a completely generic pointer type (to function or data) is `union {void (*)(void); void *}', though I can't think of any practical use for such a thing. (The (nonportable) uses I can come up with are better served by a cast rather than a union.) Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint