2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
6 .. index:: pointer arguments in variadic functions, variadic functions, pointer arguments
8 .. _variadic-pointer-args:
10 Pointer Arguments in Variadic Functions
11 ***************************************
13 Standard C requires that pointer types used with ``va_arg`` in
14 functions with variable argument lists either must be compatible with
15 that of the actual argument, or that one type must be a pointer to
16 ``void`` and the other a pointer to a character type. GNU C
17 implements the POSIX XSI extension that additionally permits the use
18 of ``va_arg`` with a pointer type to receive arguments of any other
21 In particular, in GNU C :samp:`va_arg (ap, void *)` can safely be used
22 to consume an argument of any pointer type.