Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!att!cbnewsl!dfp From: dfp@cbnewsl.ATT.COM (david.f.prosser) Newsgroups: comp.std.c Subject: Re: Question about function pointers & prototypes Message-ID: <1658@cbnewsl.ATT.COM> Date: 28 Aug 89 18:44:15 GMT References: <10835@smoke.BRL.MIL> Reply-To: dfp@cbnewsl.ATT.COM (david.f.prosser) Organization: AT&T Bell Laboratories Lines: 23 In article <10835@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes: >In article <19278@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: >>The proposed standard seems (meaning `you should check this yourself') >>to require that all function pointers `fit' in some other function pointer >>storage cell. > >I don't recall any constraints that would imply this. Pointers to >functions are far less "flexible" than object pointers. Section 3.3.4, page 47, lines 4-7: A pointer to a function of one type may be converted to a pointer to a function of another type and back again; the result shall compare equal to the original pointer. If a converted pointer is used to call a function that has a type that is not compatible with the type of the called function, the behavior is undefined. Thus all function pointers are mutually convertible. They are, as Doug noted, not convertible to or from object pointers in any portable manner. Dave Prosser ...not an official X3J11 answer...