blob: d60ca0960e5ea584d9236ccd733035a02e05a4c8 (
plain)
1
2
3
4
5
6
|
<div class="section-level-extent" id="Variadic-Pointer-Args"> <div class="nav-panel"> <p> Next: <a href="pointers-to-arrays" accesskey="n" rel="next">Pointers to Arrays with Qualifiers Work as Expected</a>, Previous: <a href="pointer-arith" accesskey="p" rel="prev">Arithmetic on <code class="code">void</code>- and Function-Pointers</a>, Up: <a href="c-extensions" accesskey="u" rel="up">Extensions to the C Language Family</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div> <h1 class="section" id="Pointer-Arguments-in-Variadic-Functions"><span>6.25 Pointer Arguments in Variadic Functions<a class="copiable-link" href="#Pointer-Arguments-in-Variadic-Functions"> ¶</a></span></h1> <p>Standard C requires that pointer types used with <code class="code">va_arg</code> in functions with variable argument lists either must be compatible with that of the actual argument, or that one type must be a pointer to <code class="code">void</code> and the other a pointer to a character type. GNU C implements the POSIX XSI extension that additionally permits the use of <code class="code">va_arg</code> with a pointer type to receive arguments of any other pointer type. </p> <p>In particular, in GNU C ‘<samp class="samp">va_arg (ap, void *)</samp>’ can safely be used to consume an argument of any pointer type. </p> </div><div class="_attribution">
<p class="_attribution-p">
© Free Software Foundation<br>Licensed under the GNU Free Documentation License, Version 1.3.<br>
<a href="https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Variadic-Pointer-Args.html" class="_attribution-link">https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Variadic-Pointer-Args.html</a>
</p>
</div>
|