Passing a `va_list *'

Roland McGrath mcgrath at tully.Berkeley.EDU
Sat Oct 28 08:04:26 AEST 1989


Is this kosher:

#include <stddef.h>

void foo(char *s, ...)
{
  va_list args;
  va_start(args, s);
  bar(va_arg(args, double));
  ack(&args);
  ugh(va_arg(args, int));
  va_end(args);
}

void ack(va_list *args)
{
  blip(va_arg(args, int **));
}

I can't tell from the Standard.  It works on machines where a `va_list' is a
pointer into the stack, but I don't know about other schemes.
--
	Roland McGrath
	Free Software Foundation, Inc.
roland at ai.mit.edu, uunet!ai.mit.edu!roland



More information about the Comp.std.c mailing list