Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: %p and different pointer representations Message-ID: <1989Mar2.173801.536@utzoo.uucp> Organization: U of Toronto Zoology References: <9382@bloom-beacon.MIT.EDU> <1089@vicorp.UUCP> <234@mstan.Morgan.COM> <16112@mimsy.UUCP> <9453@bloom-beacon.MIT.EDU> <1890@dataio.Data-IO.COM> <928@jhunix.HCF.JHU.EDU> Date: Thu, 2 Mar 89 17:38:01 GMT In article <928@jhunix.HCF.JHU.EDU> ins_balb@jhunix.UUCP (Andy Matter) writes: >#if sizeof (void *) > sizeof (void (*)()) >#define generic_ptr (void *) >#else >#define generic_ptr (void (*)()) >#endif >Then use generic_ptr instead of void *... Unfortunately, if I recall correctly (my Oct draft is out on loan), in strict ANSI C it is illegal to convert function pointers into object pointers and vice-versa. Before you scream, consider that there are architectures on which this is not a meaningful operation, and it is almost always a highly machine-specific operation. The ability to do such conversions is mentioned under "common extensions" in the appendix. -- The Earth is our mother; | Henry Spencer at U of Toronto Zoology our nine months are up. | uunet!attcan!utzoo!henry henry@zoo.toronto.edu