legality of assignment of function to a void *.

Stephen Clamage steve at taumet.com
Sun Nov 18 11:53:36 AEST 1990


blodgett at 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.  On some implementations it may not be possible (or at least not
reasonable) to cast a function pointer to a void*.  For a simple
example, consider a program on a PC in large-code-small-data model.
A function pointer is then 32 bits, but a void* is 16 bits.  One purpose
of the standard is to explain what programs can be run safely on all
conforming implementations.
-- 

Steve Clamage, TauMetric Corp, steve at taumet.com



More information about the Comp.std.c mailing list