Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!bionet!ames!uhccux!munnari.oz.au!mimir!hugin!augean!sirius!nt!levels!marwk From: MARWK@levels.sait.edu.au Newsgroups: comp.lang.c Subject: Re: Varargs problem Message-ID: <1301@levels.sait.edu.au> Date: 28 Aug 89 15:50:19 GMT References: <4YxPuc200VsnE_B3Jy@andrew.cmu.edu> Organization: Sth Australian Inst of Technology Lines: 16 In article <4YxPuc200VsnE_B3Jy@andrew.cmu.edu>, bobg+@andrew.cmu.edu (Robert Steven Glickstein) writes: > I wish to extract a variable of type "pointer to function returning int" > [(int (*) ())] from a varargs parameter list, and I can't. > > I might be able to do > > fn = (int (*) ()) va_arg(ap, char *); > > but I don't know how portable this is, ... I am not an expert, but it seems to me that one can always cast a pointer to a pointer of another type, so the above is portable - a problem might occur if one has a FAR pointer cast to a NEAR pointer, but this is architecture specific anyway. Ray