Void function pointers
Barry Margolin
barmar at think.com
Fri Jan 25 05:10:41 AEST 1991
In article <SARROYO.91Jan24120512 at govtdev-11w9.shearson.com> sarroyo at govtdev-11w9.shearson.com (Suzanne Arroyo) writes:
[Regarding passing an int(*)() to a function expecting a void(*)()]
>this works, but is messy:
> foo ( 7, 3.131592653938789, (void(*)(int, double) )bar);
Is this actually guaranteed to work right? What if the implementation uses
a different calling sequence for a function returning void from one
returning int? For instance, the space for a return value might be
allocated by the caller. Is this allowed (I know they are allowed to use
different calling sequences for varargs functions, but is the return type
also allowed to influence the calling sequence)? If so, then foo won't
call bar properly.
--
Barry Margolin, Thinking Machines Corp.
barmar at think.com
{uunet,harvard}!think!barmar
More information about the Comp.lang.c
mailing list