Newsgroups: comp.std.c Path: utzoo!henry From: henry@zoo.toronto.edu (Henry Spencer) Subject: Re: legality of assignment of function to a void *. Message-ID: <1990Nov17.042425.7388@zoo.toronto.edu> Organization: U of Toronto Zoology References: <1990Nov12.211511.2344@batcomputer.tn.cornell.edu> <1990Nov13.174920.2235@zoo.toronto.edu> <1990Nov14.031125.14027@athena.mit.edu> <4e0cac89.20b6d@apollo.HP.COM> Date: Sat, 17 Nov 90 04:24:25 GMT In article <4e0cac89.20b6d@apollo.HP.COM> blodgett@apollo.HP.COM (Bruce Blodgett) writes: >Was it really the intent of the ANSI C committee not to allow void >pointers from holding uncasted function addresses (in either >conforming or strictly conforming programs)? Yes. A void pointer, for compatibility reasons, is constrained to have the same representation as a character pointer. Pick a sufficiently outre' machine, and function pointers may well be bizarre and complex objects too large to fit in any reasonable data pointer. A function pointer is **not** (necessarily) the address of the function; functions may not even have "addresses" in any simple sense, and calling a function may require considerably more information than just where to find the code. -- "I don't *want* to be normal!" | Henry Spencer at U of Toronto Zoology "Not to worry." | henry@zoo.toronto.edu utzoo!henry