Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!news.funet.fi!tukki.jyu.fi!tukki!tt From: tt@tarzan.jyu.fi (Tapani Tarvainen) Newsgroups: comp.std.c Subject: Re: legality of assignment of function to a void *. Summary: are all function pointers created equal? Message-ID: Date: 18 Nov 90 13:45:47 GMT 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> <520@taumet.com> Sender: news@tukki.jyu.fi (News articles) Organization: University of Jyvaskyla Lines: 15 In-Reply-To: steve@taumet.com's message of 18 Nov 90 00:53:36 GMT 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@jyu.fi, tarvainen@finjyu.bitnet)