Article View: comp.std.c
Article #507Re: Question about function pointers & prototypes
From: david.f.prosser
Date: Mon, 28 Aug 1989 18:44
Date: Mon, 28 Aug 1989 18:44
23 lines
1475 bytes
1475 bytes
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...
Technical Details
Message-ID:
<1658@cbnewsl.ATT.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!att!cbnewsl!dfpReferences:
<10835@smoke.BRL.MIL>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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