🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #858

Passing a `va_list *'

#858
From: Roland McGrath
Date: Fri, 27 Oct 1989 22:04
25 lines
969 bytes
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@ai.mit.edu, uunet!ai.mit.edu!roland
Technical Details
Message-ID: <MCGRATH.89Oct27150426@tully.Berkeley.EDU>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!usc!apple!ames!pasteur!tully.Berkeley.EDU!mcgrath

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!usc!apple!ames!pasteur!tully.Berkeley.EDU!mcgrath
From: mcgrath@tully.Berkeley.EDU (Roland McGrath)
Newsgroups: comp.std.c
Subject: Passing a `va_list *'
Message-ID: <MCGRATH.89Oct27150426@tully.Berkeley.EDU>
Date: 27 Oct 89 22:04:26 GMT
Sender: news@pasteur.Berkeley.EDU
Organization: Hackers Anonymous International, Ltd., Inc. (Applications
 welcome)
Lines: 25