function returning pointer to itself

Chris Torek chris at mimsy.UUCP
Wed Jul 13 23:04:06 AEST 1988


In article <9667 at eddie.MIT.EDU> jbs at fenchurch.MIT.EDU (Jeff Siegal) writes:
>... the following should suffice:
>
>typedef void *(*NextStateFun)();

No good: the dpANS does not say that data pointers are the same `size'
as function pointers, and indeed, on (e.g.) the Univac 1100 series, as
I understand it, data pointers are 2 words while function pointers are
18 words.  Hence stuffing a function pointer into a data pointer will
lose information.  The dpANS *does* guarantee that pointers to functions
are all the same `size' (I think), so:

	typedef void (*(*NextStateFun)())();

and go from there.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.std.c mailing list