legality of assignment of function to a void *.

Tapani Tarvainen tt at tarzan.jyu.fi
Mon Nov 19 00:45:47 AEST 1990


If I want a variable to be able to hold pointers to different
functions, do I have to use union and list all function types I want,
or can I assume all function pointers are similar and can (with
suitable cast) be assigned to variables of different function pointer
type safely?  Or is there some funtion pointer type that can be relied
on to be bigger than and thus able to hold any other?

Example:  A hypothetical compiler for 80x86 tries to put all functions
of the same type in the same segment and if they fit, uses 16-bit
pointers for them (and for each call generates code that uses the
correct segment), otherwise 32-bit ones.  
Would it be standard-conforming?
--
Tapani Tarvainen    (tarvaine at jyu.fi, tarvainen at finjyu.bitnet)



More information about the Comp.std.c mailing list