Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!ncar!gatech!usenet.ins.cwru.edu!ncoast!catfood From: catfood@NCoast.ORG (Mark W. Schumann) Newsgroups: comp.lang.c Subject: Re: varargs -> varargs mystery Message-ID: <1991May6.040825.19588@NCoast.ORG> Date: 6 May 91 04:08:25 GMT References: <3099@cirrusl.UUCP> <1991May2.170148.12655@sparky.IMD.Sterling.COM> <4606@skye.ed.ac.uk> Organization: North Coast Public Access Un*x (ncoast) Lines: 24 richard@aiai.uucp (Richard Tobin) writes: >In article <1991May2.170148.12655@sparky.IMD.Sterling.COM> rick@sparky.IMD.Sterling.COM (Richard Ohnemus) writes: >>In article <3099@cirrusl.UUCP> Rahul Dhesi writes: >>>Suppose A is a varargs function, and it uses the first argument >>>supplied, and passes on the rest to B, which is also a varargs >>>function. What is the right way to do it? > >It can't be done. What Rahul wants is the equivalent of Lisp's >"apply", and C doesn't have one. > >>Just pass the variable argument list pointer instead of the address of >>the pointer. > >Note that he wanted to pass the arguments on to another varargs >function, not one that took a single va_list argument. > Actually, I think this can be done, but not in any guaranteed portable way. (To many, that means it can't be done. :-) ) -- ============================================================ Mark W. Schumann 3111 Mapledale Avenue, Cleveland 44109 USA Domain: catfood@ncoast.org UUCP: ...!mailrus!usenet.ins.cwru.edu!ncoast!catfood