Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!bellcore!uunet!zaphod.mps.ohio-state.edu!think.com!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.lang.c Subject: Re: Void function pointers Message-ID: <1991Jan24.181041.4894@Think.COM> Date: 24 Jan 91 18:10:41 GMT References: <2887@casbah.acns.nwu.edu> Sender: news@Think.COM Distribution: usa Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 18 In article sarroyo@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@think.com {uunet,harvard}!think!barmar