COHERENT manpages

This page displays the COHERENT manpage for va_end() [Tidy up after traversal of argument list].

List of available manpages
Index


va_end() -- Variable Arguments

Tidy up after traversal of argument list
#include <stdarg.h>
void va_end(listptr)
va_list listptr;

#include <varargs.h>
void va_end(listptr)
va_list listptr;

va_end() helps  to tidy up a  function after it has  traversed the argument
list for a  function that takes a variable number  of arguments.  It can be
used  with functions  that take  a  variable number  of arguments,  such as
printf() or  scanf(), to help write such functions  portably.  It should be
used with the routines va_arg()  and va_start() from within a function that
takes a variable number of arguments.

listptr is of type va_list(), which is declared in header stdarg.h. listptr
must first have been initialized by macro va_start.

Example

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

See Also

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

Notes

There are  two different versions  of va_end(): the ANSI  version, which is
defined  in <stdarg.h>;  and the  UNIX version,  which is  defined in
<varargs.h>. For  a discussion  of how these  implementations differ,
see the entry for stdarg.h.

If va_list() is not initialized by va_start(), or if va_end() is not called
before  a function  with  variable arguments  exits, then  the behavior  of
va_end() is undefined.