Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!pasteur!paris.Berkeley.EDU!mcgrath From: mcgrath@paris.Berkeley.EDU (Roland McGrath) Newsgroups: comp.std.c Subject: Re: Passing a `va_list *' Message-ID: Date: 28 Oct 89 22:09:27 GMT References: <11439@smoke.BRL.MIL> Sender: news@pasteur.Berkeley.EDU Organization: Hackers Anonymous International, Ltd., Inc. (Applications welcome) Lines: 31 In-reply-to: gwyn@smoke.BRL.MIL's message of 28 Oct 89 05:56:13 GMT My example did indeed have typos. What I meant was: #include void foo(const char *s, ...) { va_list args; va_start(args, s); bar1(va_arg(args, int)); ack(&args); bar2(va_arg(args, float *)); va_end(args); } void ack(va_list *args) { blip(va_arg(*args, int **)); } I have a somewhat old draft of the Standard (May 1988), but I can't find anything that actually says this isn't allowed. I don't see the problem with whatever type `va_list' is. You can take the address of an object of any type (though not every storage class), and dereference the pointer thus obtained. -- Roland McGrath Free Software Foundation, Inc. roland@ai.mit.edu, uunet!ai.mit.edu!roland