legality of assignment of function to a void *.

Martin Weitzel martin at mwtech.UUCP
Tue Nov 20 00:14:03 AEST 1990


In article <1990Nov14.031125.14027 at athena.mit.edu> tada at athena.mit.edu (Michael J Zehr) writes:
[function pointers beeing completly different creatures than data pointers]

>My main
>source of confusion was K&R2 (p. 199, "Any pointer may be converted to
>type void * without loss of information.  If the result is converted
>back to the original pointer type, the original pointer is recovered.")
>
>This seems very misleading to me.  (Yes, I know that K&R2 is not the
>official ANSI specification for C.)

Yes, it seems a problem fopr me too that there are some "references" which
in general appear well-trustable (like K&R-II) but fail to specify a few
not so well known portability traps.

How about adding a list of such things to the FAQ in c.l.c? I think
this would be helpful to the vast majority, who either can't afford
the X3.159-1989 document because of the high price, or who don't have
the time and patience to read it very very carefully.

The problem may be that such a list should not degenerate into
(another) specification of ANSI C, but that is not be so hard to
avoid if we leave out all things, that are obvious from K&R-II,
or rather esoteric.
-- 
Martin Weitzel, email: martin at mwtech.UUCP, voice: 49-(0)6151-6 56 83



More information about the Comp.std.c mailing list