Question about function pointers & prototypes

david.f.prosser dfp at cbnewsl.ATT.COM
Tue Aug 29 04:44:15 AEST 1989


In article <10835 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
>In article <19278 at mimsy.UUCP> chris at 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...



More information about the Comp.std.c mailing list