COHERENT manpages

This page displays the COHERENT manpage for va_start() [Point to beginning of argument list].

List of available manpages
Index


va_start() -- Variable Arguments

Point to beginning of argument list
#include <varargs.h>
void va_start(listptr)
va_list listptr;

#include <stdarg.h>
void va_start(listptr, rightparm)
va_list listptr, type rightparm;

va_start() is a macro that points  to the beginning of a list of arguments.
It can  be used with  functions that take  a variable number  of arguments,
such as printf() or scanf(), to help implement them portably.  It is always
used  with  va_arg() and  va_end()  from  within a  function  that takes  a
variable number of arguments.

This macro  is defined in two different  header files, <stdarg.h> and
<varargs.h>. The  former header  file is the  creation of the  ANSI C
committee,  whereas the  latter  originates with  UNIX System  V.  In  both
implementations, the first argument is listptr, which is of type va_list.

The  implementation  in <stdarg.h>  (ANSI)  adds  a second  argument,
rightparm,  which  is   the  rightmost  parameter  preceding  the  variable
arguments in the  function's parameter list.  Undefined behavior results if
any of the following conditions apply to rightparm: if it has storage class
register; if it has a function type or an array type; or if its type is not
compatible with the type that results from the default argument promotions.

Example

For an example of this macro, see the entry for stdarg.h.

See Also

stdarg.h,
varargs.h
ANSI Standard, §7.8.1.1

Notes

For  a  discussion   of  how  the  <stdarg.h>  and  <varargs.h>
implementations of the variable-argument routines differ, stdarg.h.

The ANSI  Standard demands that va_start() be implemented  only as a macro.
If the  macro definition of va_start() is suppressed  within a program, the
behavior is undefined (and probably unwelcome).