<!DOCTYPE html>
<html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-0 vector-toc-not-available vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-0 skin-theme-clientpref-os vector-sticky-header-enabled" lang="en" dir="ltr"><head>
    <meta charset="UTF-8">
    <title>Stdarg.h</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" type="image/png" href="./_res_/favicon.png">
    <link rel="canonical" href="https://en.wikipedia.org/wiki/Stdarg.h"> <link href="./_mw_/ext.cite.styles.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/ext.pygments.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/ext.wikimediamessages.styles.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/skins.vector.icons.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/skins.vector.styles.css" rel="stylesheet" type="text/css">
    <meta name="ResourceLoaderDynamicStyles" content="">
    
    <link rel="stylesheet" type="text/css" href="./_mw_/site.styles.css">
    <link rel="stylesheet" type="text/css" href="./_mw_/noscript.css">
    <link rel="stylesheet" type="text/css" href="./_res_/footer.css">
    <link rel="stylesheet" type="text/css" href="./_res_/vector-2022.css">
  </head>
  <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Stdarg_h rootpage-Stdarg_h skin-vector-2022 action-view">
    <div class="mw-page-container">
      <div class="mw-page-container-inner">
        <div class="mw-content-container">
          <main id="content" class="mw-body">
            <header class="mw-body-header vector-page-titlebar">
              <h1 id="firstHeading" class="firstHeading mw-first-heading">stdarg.h</h1>
            </header>
            <a id="top"></a>
            <div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
              <div id="contentSub">
                <div id="mw-content-subtitle"></div>
              </div>
              <div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<style data-mw-deduplicate="TemplateStyles:r1333133064">
/* start https://en.wikipedia.org/ */


.mw-parser-output .hlist dl,.mw-parser-output .hlist ol,.mw-parser-output .hlist ul{margin:0;padding:0}.mw-parser-output .hlist dd,.mw-parser-output .hlist dt,.mw-parser-output .hlist li{margin:0;display:inline}.mw-parser-output .hlist.inline,.mw-parser-output .hlist.inline dl,.mw-parser-output .hlist.inline ol,.mw-parser-output .hlist.inline ul,.mw-parser-output .hlist dl dl,.mw-parser-output .hlist dl ol,.mw-parser-output .hlist dl ul,.mw-parser-output .hlist ol dl,.mw-parser-output .hlist ol ol,.mw-parser-output .hlist ol ul,.mw-parser-output .hlist ul dl,.mw-parser-output .hlist ul ol,.mw-parser-output .hlist ul ul{display:inline}.mw-parser-output .hlist .mw-empty-li{display:none}.mw-parser-output .hlist dt::after{content:": "}.mw-parser-output .hlist dd::after,.mw-parser-output .hlist li::after{content:"\a0 · ";font-weight:bold}.mw-parser-output .hlist dd:last-child::after,.mw-parser-output .hlist dt:last-child::after,.mw-parser-output .hlist li:last-child::after{content:none}.mw-parser-output .hlist dd dd:first-child::before,.mw-parser-output .hlist dd dt:first-child::before,.mw-parser-output .hlist dd li:first-child::before,.mw-parser-output .hlist dt dd:first-child::before,.mw-parser-output .hlist dt dt:first-child::before,.mw-parser-output .hlist dt li:first-child::before,.mw-parser-output .hlist li dd:first-child::before,.mw-parser-output .hlist li dt:first-child::before,.mw-parser-output .hlist li li:first-child::before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child::after,.mw-parser-output .hlist dd dt:last-child::after,.mw-parser-output .hlist dd li:last-child::after,.mw-parser-output .hlist dt dd:last-child::after,.mw-parser-output .hlist dt dt:last-child::after,.mw-parser-output .hlist dt li:last-child::after,.mw-parser-output .hlist li dd:last-child::after,.mw-parser-output .hlist li dt:last-child::after,.mw-parser-output .hlist li li:last-child::after{content:")";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li::before{content:" "counter(listitem)"\a0 "}.mw-parser-output .hlist dd ol>li:first-child::before,.mw-parser-output .hlist dt ol>li:first-child::before,.mw-parser-output .hlist li ol>li:first-child::before{content:" ("counter(listitem)"\a0 "}


/* end   https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r1246091330">
/* start https://en.wikipedia.org/ */


.mw-parser-output .sidebar{width:22em;float:right;clear:right;margin:0.5em 0 1em 1em;background:var(--background-color-neutral-subtle,#f8f9fa);border:1px solid var(--border-color-base,#a2a9b1);padding:0.2em;text-align:center;line-height:1.4em;font-size:88%;border-collapse:collapse;display:table}body.skin-minerva .mw-parser-output .sidebar{display:table!important;float:right!important;margin:0.5em 0 1em 1em!important}.mw-parser-output .sidebar-subgroup{width:100%;margin:0;border-spacing:0}.mw-parser-output .sidebar-left{float:left;clear:left;margin:0.5em 1em 1em 0}.mw-parser-output .sidebar-none{float:none;clear:both;margin:0.5em 1em 1em 0}.mw-parser-output .sidebar-outer-title{padding:0 0.4em 0.2em;font-size:125%;line-height:1.2em;font-weight:bold}.mw-parser-output .sidebar-top-image{padding:0.4em}.mw-parser-output .sidebar-top-caption,.mw-parser-output .sidebar-pretitle-with-top-image,.mw-parser-output .sidebar-caption{padding:0.2em 0.4em 0;line-height:1.2em}.mw-parser-output .sidebar-pretitle{padding:0.4em 0.4em 0;line-height:1.2em}.mw-parser-output .sidebar-title,.mw-parser-output .sidebar-title-with-pretitle{padding:0.2em 0.8em;font-size:145%;line-height:1.2em}.mw-parser-output .sidebar-title-with-pretitle{padding:0.1em 0.4em}.mw-parser-output .sidebar-image{padding:0.2em 0.4em 0.4em}.mw-parser-output .sidebar-heading{padding:0.1em 0.4em}.mw-parser-output .sidebar-content{padding:0 0.5em 0.4em}.mw-parser-output .sidebar-content-with-subgroup{padding:0.1em 0.4em 0.2em}.mw-parser-output .sidebar-above,.mw-parser-output .sidebar-below{padding:0.3em 0.8em;font-weight:bold}.mw-parser-output .sidebar-collapse .sidebar-above,.mw-parser-output .sidebar-collapse .sidebar-below{border-top:1px solid #aaa;border-bottom:1px solid #aaa}.mw-parser-output .sidebar-navbar{text-align:right;font-size:115%;padding:0 0.4em 0.4em}.mw-parser-output .sidebar-list-title{padding:0 0.4em;text-align:left;font-weight:bold;line-height:1.6em;font-size:105%}.mw-parser-output .sidebar-list-title-c{padding:0 0.4em;text-align:center;margin:0 3.3em}@media(max-width:640px){body.mediawiki .mw-parser-output .sidebar{width:100%!important;clear:both;float:none!important;margin-left:0!important;margin-right:0!important}}body.skin--responsive .mw-parser-output .sidebar a>img{max-width:none!important}@media screen{html.skin-theme-clientpref-night .mw-parser-output .sidebar:not(.notheme) .sidebar-list-title,html.skin-theme-clientpref-night .mw-parser-output .sidebar:not(.notheme) .sidebar-title-with-pretitle{background:transparent!important}html.skin-theme-clientpref-night .mw-parser-output .sidebar:not(.notheme) .sidebar-title-with-pretitle a{color:var(--color-progressive)!important}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .sidebar:not(.notheme) .sidebar-list-title,html.skin-theme-clientpref-os .mw-parser-output .sidebar:not(.notheme) .sidebar-title-with-pretitle{background:transparent!important}html.skin-theme-clientpref-os .mw-parser-output .sidebar:not(.notheme) .sidebar-title-with-pretitle a{color:var(--color-progressive)!important}}@media print{body.ns-0 .mw-parser-output .sidebar{display:none!important}}


/* end   https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r1238254908">
/* start https://en.wikipedia.org/ */


.mw-parser-output .c-standard-library .sidebar-content{text-align:left}


/* end   https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r886049734">
/* start https://en.wikipedia.org/ */


.mw-parser-output .monospaced{font-family:monospace,monospace}


/* end   https://en.wikipedia.org/ */
</style><table class="sidebar nomobile nowraplinks c-standard-library" role="navigation"><tbody><tr><th class="sidebar-title"><a href="C_standard_library" title="C standard library">C standard library</a> (libc)</th></tr><tr><th class="sidebar-heading">
General topics</th></tr><tr><td class="sidebar-content">
<ul><li><a href="C_data_types" title="C data types">Data types</a></li>
<li><a href="C_character_classification" title="C character classification">Character classification</a></li>
<li><a href="C_string_handling" title="C string handling">Strings</a></li>
<li><a href="C_mathematical_functions" title="C mathematical functions">Mathematics</a></li>
<li><a href="C_file_input/output" title="C file input/output">File input/output</a></li>
<li><a href="C_date_and_time_functions" title="C date and time functions">Date/time</a></li>
<li><a href="C_localization_functions" title="C localization functions">Localization</a></li>
<li><a href="C_dynamic_memory_allocation" title="C dynamic memory allocation">Memory allocation</a></li>
<li><a href="C_process_control" title="C process control">Process control</a></li>
<li><a href="C_signal_handling" title="C signal handling">Signals</a></li>
<li><a href="C_alternative_tokens" title="C alternative tokens">Alternative tokens</a></li></ul></td>
</tr><tr><th class="sidebar-heading">
Miscellaneous headers</th></tr><tr><td class="sidebar-content">
<ul><li><span class="monospaced">&lt;<a href="Assert.h" title="Assert.h">assert.h</a>&gt;</span></li>
<li><span class="monospaced">&lt;<a href="Errno.h" title="Errno.h">errno.h</a>&gt;</span></li>
<li><span class="monospaced">&lt;<a href="Setjmp.h" title="Setjmp.h">setjmp.h</a>&gt;</span></li>
<li><span class="monospaced">&lt;<a class="mw-selflink selflink">stdarg.h</a>&gt;</span></li></ul></td>
</tr><tr><td class="sidebar-navbar"><style data-mw-deduplicate="TemplateStyles:r1239400231">
/* start https://en.wikipedia.org/ */


.mw-parser-output .navbar{display:inline;font-size:88%;font-weight:normal}.mw-parser-output .navbar-collapse{float:left;text-align:left}.mw-parser-output .navbar-boxtext{word-spacing:0}.mw-parser-output .navbar ul{display:inline-block;white-space:nowrap;line-height:inherit}.mw-parser-output .navbar-brackets::before{margin-right:-0.125em;content:"[ "}.mw-parser-output .navbar-brackets::after{margin-left:-0.125em;content:" ]"}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbar a>span,.mw-parser-output .navbar a>abbr{text-decoration:inherit}.mw-parser-output .navbar-mini abbr{font-variant:small-caps;border-bottom:none;text-decoration:none;cursor:inherit}.mw-parser-output .navbar-ct-full{font-size:114%;margin:0 7em}.mw-parser-output .navbar-ct-mini{font-size:114%;margin:0 4em}html.skin-theme-clientpref-night .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}@media(prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}}@media print{.mw-parser-output .navbar{display:none!important}}


/* end   https://en.wikipedia.org/ */
</style></td></tr></tbody></table>
<p><b><span class="monospaced">&lt;stdarg.h&gt;</span></b> is a header in the <a href="C_standard_library" title="C standard library">C standard library</a> of the <a href="C_(programming_language)" title="C (programming language)">C programming language</a> that allows functions to accept <a href="Variadic_function" title="Variadic function">an indefinite number of arguments</a>.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> It provides facilities for stepping through a list of function arguments of unknown number and type.  <a href="C%2B%2B" title="C++">C++</a> provides this functionality in the header <code>&lt;cstdarg&gt;</code>.
</p><p>The contents of <code>&lt;stdarg.h&gt;</code> are typically used in <a href="Variadic_function" title="Variadic function">variadic functions</a>, though they may be used in other functions (for example, <code><a href="Vprintf" class="mw-redirect" title="Vprintf">vprintf</a></code>) called by variadic functions.
</p>

<div class="mw-heading mw-heading2"><h2 id="Creating_variadic_functions">Creating variadic functions</h2></div>
<p><a href="Variadic_functions" class="mw-redirect" title="Variadic functions">Variadic functions</a> are functions which may take a variable number of arguments and are declared with an <a href="Ellipsis" title="Ellipsis">ellipsis</a> in place of the last parameter. An example of such a function is <code><a href="Printf" title="Printf">printf</a></code>. Respectively, declarations and definitions are done similarly as such
</p>
<div class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><pre><span></span><span class="kt">int</span><span class="w"> </span><span class="nf">check</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">a</span><span class="p">,</span><span class="w"> </span><span class="kt">double</span><span class="w"> </span><span class="n">b</span><span class="p">,</span><span class="w"> </span><span class="p">...);</span>

<span class="kt">int</span><span class="w"> </span><span class="nf">check</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">a</span><span class="p">,</span><span class="w"> </span><span class="kt">double</span><span class="w"> </span><span class="n">b</span><span class="p">,</span><span class="w"> </span><span class="p">...)</span><span class="w"> </span><span class="p">{</span>
<span class="w">    </span><span class="c1">// ...</span>
<span class="p">}</span>
</pre></div>
<p>According to the standard, varadic functions without any named parameters are not allowed in <a href="C17_(C_standard_revision)" title="C17 (C standard revision)"> C17</a> and earlier, but in <a href="C%2B%2B" title="C++">C++</a> and <a href="C23_(C_standard_revision)" title="C23 (C standard revision)">C23</a><sup id="cite_ref-N2975_2-0" class="reference"><a href="#cite_note-N2975-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> such a declaration is permitted.
</p><p>In <a href="C_(programming_language)" title="C (programming language)">C</a>, a comma must precede the ellipsis if a named parameter is specified, while in <a href="C%2B%2B" title="C++">C++</a> it was optional until <a href="C%2B%2B26" title="C++26">C++26</a> when this was deprecated.
</p><p>Some <a href="K%26R_C" class="mw-redirect" title="K&amp;R C">K&amp;R C</a> style function declarations do not use ellipses.<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="stdarg.h_types">stdarg.h types</h2></div>
<table class="wikitable">

<tbody><tr>
<th>Name</th>
<th>Description</th>
<th>Compatibility
</th></tr>
<tr>
<td><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/cpp/utility/variadic/va_list">va_list</a></code></td>
<td>type for iterating arguments</td>
<td><a href="C89_(C_version)" class="mw-redirect" title="C89 (C version)">C89</a>
</td></tr></tbody></table>
<div class="mw-heading mw-heading2"><h2 id="stdarg.h_macros">stdarg.h macros</h2></div>
<table class="wikitable">

<tbody><tr>
<th>Name</th>
<th>Description</th>
<th>compatibility
</th></tr>
<tr>
<td><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/cpp/utility/variadic/va_start">va_start</a></code></td>
<td>Start iterating arguments with a <code>va_list</code></td>
<td><a href="C89_(C_version)" class="mw-redirect" title="C89 (C version)">C89</a>
</td></tr>
<tr>
<td><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/cpp/utility/variadic/va_arg">va_arg</a></code></td>
<td>Retrieve an argument</td>
<td><a href="C89_(C_version)" class="mw-redirect" title="C89 (C version)">C89</a>
</td></tr>
<tr>
<td><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/cpp/utility/variadic/va_end">va_end</a></code></td>
<td>Free a <code>va_list</code></td>
<td><a href="C89_(C_version)" class="mw-redirect" title="C89 (C version)">C89</a>
</td></tr>
<tr>
<td><code><a rel="nofollow" class="external text" href="http://en.cppreference.com/w/cpp/utility/variadic/va_copy">va_copy</a></code></td>
<td>Copy contents of one <code>va_list</code> to another</td>
<td><a href="C99" title="C99">C99</a>
</td></tr></tbody></table>
<div class="mw-heading mw-heading2"><h2 id="Accessing_the_arguments">Accessing the arguments</h2></div>
<p>According to the standard, to access the unnamed arguments it can be through a variable of type <code>va_list</code> in the variadic function, with macro <code>va_start</code> also provided as the last named parameter of the function. In C23  the second argument is optional and will not be evaluated.<sup id="cite_ref-N2975_2-1" class="reference"><a href="#cite_note-N2975-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>
After this, each invocation of the <code>va_arg</code> macro yields the next argument. The first argument to <code>va_arg</code> is the <code>va_list</code> and the second is the type of the next argument passed to the function. As the last step, the <code>va_end</code> macro must be called on the <code>va_list</code> before the function returns. Note that it is not required to read in all the arguments.
</p><p><a href="C99" title="C99">C99</a> provides an additional macro, <code>va_copy</code>, which can duplicate the state of a <code>va_list</code>. The macro invocation <code>va_copy(va2, va1)</code> copies <code>va1</code> into <code>va2</code>.
</p><p>There is no defined method for counting or classifying the unnamed arguments passed to the variadic function. The function should simply determine this somehow, the means of which vary.  Common conventions include:
</p>
<ul><li>Use of a <code><a href="Printf" title="Printf">printf</a></code> or <code><a href="Scanf" title="Scanf">scanf</a></code>-like format string with embedded specifiers that indicate argument types.</li>
<li>A <a href="Sentinel_value" title="Sentinel value">sentinel value</a> at the end of the variadic arguments.</li>
<li>A count argument indicating the number of variadic arguments.</li></ul>
<div class="mw-heading mw-heading3"><h3 id="Passing_unnamed_arguments_to_other_calls">Passing unnamed arguments to other calls</h3></div>
<p>As the size of the unnamed argument list is generally unknown, the calling conventions employed by most compilers do not permit determining the size of the unnamed argument block pointed at by <code>va_list</code> inside the receiving function. As a result there is also no reliable, generic way to forward the unnamed arguments into another variadic function. Even where determining the size of the argument list is possible by indirect means (for example, by parsing the format string of <code>fprintf()</code>), there is no portable way to pass the dynamically determined number of arguments into the inner variadic call, as the number and size of arguments passed into such calls must generally be known at compile time. To some extent, this restriction can be relaxed by employing <a href="Variadic_macro" class="mw-redirect" title="Variadic macro">variadic macros</a> instead of variadic functions. Additionally, most standard library procedures provide <code>v</code>-prefixed alternative versions which accept a <i>reference</i> to the unnamed argument list (i.e. an initialized <code>va_list</code> variable) instead of the unnamed argument list itself. For example, <code>vfprintf()</code> is an alternate version of <code>fprintf()</code> expecting a <code>va_list</code> instead of the actual unnamed argument list. A user-defined variadic function can therefore initialize a <code>va_list</code> variable using <code>va_start</code> and pass it to an appropriate standard library function, in effect passing the unnamed argument list by reference instead of doing it by value. Because there is no reliable way to pass unnamed argument lists by value in C, providing variadic <a href="Application_programming_interface" class="mw-redirect" title="Application programming interface">API</a> functions without also providing equivalent functions accepting <code>va_list</code> instead is considered a bad programming practice.
</p>
<div class="mw-heading mw-heading2"><h2 id="Type_safety">Type safety</h2></div>
<p>Some C implementations provide C extensions that allow the compiler to check for the proper use of format strings and sentinels.  Barring these extensions, the compiler usually cannot check whether the unnamed arguments passed are of the type the function expects, or convert them to the required type. Therefore, care should be taken to ensure correctness in this regard, since <a href="Undefined_behavior" title="Undefined behavior">undefined behavior</a> results if the types do not match. For example, if the expected type is <code>int*</code>, then a null pointer should be passed as <code>(int*)NULL</code>. Writing just <code>NULL</code> would result in an argument of type either <code>int</code> or <code>void*</code>, neither of which is correct. Another consideration is the default argument <a href="Type_conversion#Type_promotion" title="Type conversion">promotions</a> applied to the unnamed arguments. A <code>float</code> will automatically be promoted to a <code>double</code>. Likewise, arguments of types narrower than an <code>int</code> will be promoted to <code>int</code> or <code>unsigned int</code>. The function receiving the unnamed arguments must expect the promoted type.
</p><p><a href="GNU_Compiler_Collection" title="GNU Compiler Collection">GCC</a> has an attribute that checks the passed arguments: <code class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><span class="p">[[</span><span class="n">gnu</span><span class="o">::</span><span class="n">format</span><span class="p">(</span><span class="n">style</span><span class="p">,</span><span class="w"> </span><span class="n">format_index</span><span class="p">,</span><span class="w"> </span><span class="n">first_to_check</span><span class="p">)]]</span></code>.<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> The format attribute specifies that a function takes <code>printf</code>, <code>scanf</code>, <code>strftime</code> or <code>strfmon</code> style arguments which should be type-checked against a format string. For example, the declaration:
</p>
<div class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><pre><span></span><span class="p">[[</span><span class="n">gnu</span><span class="o">::</span><span class="n">format</span><span class="p">(</span><span class="n">printf</span><span class="p">,</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="mi">3</span><span class="p">)]]</span>
<span class="k">extern</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="n">my_printf</span><span class="p">(</span><span class="kt">void</span><span class="o">*</span><span class="w"> </span><span class="n">obj</span><span class="p">,</span><span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="o">*</span><span class="w"> </span><span class="n">fmt</span><span class="p">,</span><span class="w"> </span><span class="p">...);</span>
</pre></div>
<p>causes the compiler to check the arguments in calls to <code>my_printf</code> for consistency with the <code>printf</code> style format string argument <code>my_format</code><sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Example">Example</h2></div>
<div class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><pre><span></span><span class="cp">#include</span><span class="w"> </span><span class="cpf">&lt;stdio.h&gt;</span>
<span class="cp">#include</span><span class="w"> </span><span class="cpf">&lt;stdarg.h&gt;</span>

<span class="c1">// Get sum of variables</span>
<span class="kt">int</span><span class="w"> </span><span class="nf">sum</span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">count</span><span class="p">,</span><span class="w"> </span><span class="p">...)</span><span class="w"> </span><span class="p">{</span>
<span class="w">    </span><span class="kt">va_list</span><span class="w"> </span><span class="n">ap</span><span class="p">;</span>
<span class="w">    </span><span class="kt">int</span><span class="w"> </span><span class="n">total</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
<span class="w">    </span><span class="n">va_start</span><span class="p">(</span><span class="n">ap</span><span class="p">,</span><span class="w"> </span><span class="n">count</span><span class="p">);</span><span class="w"> </span>
<span class="w">    </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&lt;</span><span class="w"> </span><span class="n">count</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="o">++</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">        </span><span class="n">total</span><span class="w"> </span><span class="o">+=</span><span class="w"> </span><span class="n">va_arg</span><span class="p">(</span><span class="n">ap</span><span class="p">,</span><span class="w"> </span><span class="kt">int</span><span class="p">);</span>
<span class="w">    </span><span class="p">}</span>
<span class="w">    </span><span class="n">va_end</span><span class="p">(</span><span class="n">ap</span><span class="p">);</span>
<span class="w">    </span><span class="k">return</span><span class="w"> </span><span class="n">total</span><span class="p">;</span>
<span class="p">}</span>

<span class="kt">int</span><span class="w"> </span><span class="nf">main</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">   </span><span class="n">printf</span><span class="p">(</span><span class="s">"%i"</span><span class="p">,</span><span class="w"> </span><span class="n">sum</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">3</span><span class="p">));</span>
<span class="w">   </span><span class="k">return</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
<p>This program should get the following output:
</p>
<pre>4
</pre>
<div class="mw-heading mw-heading2"><h2 id="<varargs.h>"><span id=".3Cvarargs.h.3E"></span><span class="monospaced">&lt;varargs.h&gt;</span></h2></div>
<p>Outdated versions of <a href="POSIX" title="POSIX">POSIX</a> defined the legacy header <code>&lt;varargs.h&gt;</code>, which dates from before the standardization of C and provides functionality similar to <code>&lt;stdarg.h&gt;</code>. This header is part of neither ISO C nor POSIX. The file, as defined in the second version of the <a href="Single_UNIX_Specification" title="Single UNIX Specification">Single UNIX Specification</a>, simply contains all of the functionality of C89 <code>&lt;stdarg.h&gt;</code>, with the exceptions that:
</p>
<ul><li>it cannot be used in standard C new-style definitions</li>
<li>the given argument may be omitted (standard C requires at least one argument)</li></ul>
<p>The interface is also different. For <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">printargs</code> example, one would instead write:
</p>
<div class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><pre><span></span><span class="cp">#include</span><span class="w"> </span><span class="cpf">&lt;stdio.h&gt;</span>
<span class="cp">#include</span><span class="w"> </span><span class="cpf">&lt;varargs.h&gt;</span>

<span class="cm">/**</span>
<span class="cm"> * This is K&amp;R C (pre-C89).</span>
<span class="cm"> * There is no "void" type; use an implicit int return.</span>
<span class="cm"> */</span>
<span class="n">printargs</span><span class="p">(</span><span class="n">arg1</span><span class="p">,</span><span class="w"> </span><span class="n">va_alist</span><span class="p">)</span>
<span class="w">    </span><span class="n">va_dcl</span><span class="w"> </span><span class="cm">/* no semicolon here! */</span>
<span class="p">{</span>
<span class="w">    </span><span class="kt">va_list</span><span class="w"> </span><span class="n">ap</span><span class="p">;</span>
<span class="w">    </span><span class="kt">int</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>

<span class="w">    </span><span class="n">va_start</span><span class="p">(</span><span class="n">ap</span><span class="p">);</span><span class="w"> </span><span class="cm">/* only the va_list is given! */</span>
<span class="w">    </span><span class="k">for</span><span class="w"> </span><span class="p">(</span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">arg1</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">&gt;=</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span><span class="w"> </span><span class="n">i</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">va_arg</span><span class="p">(</span><span class="n">ap</span><span class="p">,</span><span class="w"> </span><span class="kt">int</span><span class="p">))</span><span class="w"> </span><span class="p">{</span>
<span class="w">        </span><span class="n">printf</span><span class="p">(</span><span class="s">"%d "</span><span class="p">,</span><span class="w"> </span><span class="n">i</span><span class="p">);</span>
<span class="w">    </span><span class="p">}</span>
<span class="w">    </span><span class="n">va_end</span><span class="p">(</span><span class="n">ap</span><span class="p">);</span>
<span class="w">    </span><span class="n">putchar</span><span class="p">(</span><span class="sc">'\n'</span><span class="p">);</span>
<span class="w">    </span><span class="k">return</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
<p>and is called the same way.
</p><p><code>varargs.h</code> requires old-style function definitions because of the way the implementation works.<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup> Conversely, it is not possible to mix old-style function definitions with <code>stdarg.h</code>.
</p>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1327269900">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}body.skin-vector-2022 .mw-parser-output .reflist-columns-2{column-width:27em}body.skin-vector-2022 .mw-parser-output .reflist-columns-3{column-width:22.5em}.mw-parser-output .references[data-mw-group=upper-alpha]{list-style-type:upper-alpha}.mw-parser-output .references[data-mw-group=upper-roman]{list-style-type:upper-roman}.mw-parser-output .references[data-mw-group=lower-alpha]{list-style-type:lower-alpha}.mw-parser-output .references[data-mw-group=lower-greek]{list-style-type:lower-greek}.mw-parser-output .references[data-mw-group=lower-roman]{list-style-type:lower-roman}.mw-parser-output div.reflist-liststyle-upper-alpha .references{list-style-type:upper-alpha}.mw-parser-output div.reflist-liststyle-upper-roman .references{list-style-type:upper-roman}.mw-parser-output div.reflist-liststyle-lower-alpha .references{list-style-type:lower-alpha}.mw-parser-output div.reflist-liststyle-lower-greek .references{list-style-type:lower-greek}.mw-parser-output div.reflist-liststyle-lower-roman .references{list-style-type:lower-roman}


/* end   https://en.wikipedia.org/ */
</style><div>
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1333433106">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./_mw_/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./_mw_/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./_mw_/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./_mw_/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#bf3c2c)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#bf3c2c)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end   https://en.wikipedia.org/ */
</style><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.opengroup.org/onlinepubs/009695399/basedefs/stdarg.h.html">"IEEE Std 1003.1 <code>stdarg.h</code>"</a><span class="reference-accessdate">. Retrieved <span class="nowrap">2009-07-04</span></span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=unknown&amp;rft.btitle=IEEE+Std+1003.1+%3Ccode%3Estdarg.h%3C%2Fcode%3E&amp;rft_id=http%3A%2F%2Fwww.opengroup.org%2Fonlinepubs%2F009695399%2Fbasedefs%2Fstdarg.h.html&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AStdarg.h" class="Z3988"></span></span>
</li>
<li id="cite_note-N2975-2"><span class="mw-cite-backlink">^ <a href="#cite_ref-N2975_2-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-N2975_2-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><cite id="CITEREFGildingMeneide2022" class="citation web cs1">Gilding, Alex; Meneide, JeanHeyd (2022-04-15). <a rel="nofollow" class="external text" href="https://open-std.org/JTC1/SC22/WG14/www/docs/n2975.pdf">"WG14-N2975&nbsp;: Relax requirements for variadic parameter lists, v3"</a> <span class="cs1-format">(PDF)</span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=unknown&amp;rft.btitle=WG14-N2975+%3A+Relax+requirements+for+variadic+parameter+lists%2C+v3&amp;rft.date=2022-04-15&amp;rft.aulast=Gilding&amp;rft.aufirst=Alex&amp;rft.au=Meneide%2C+JeanHeyd&amp;rft_id=https%3A%2F%2Fopen-std.org%2FJTC1%2FSC22%2FWG14%2Fwww%2Fdocs%2Fn2975.pdf&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AStdarg.h" class="Z3988"></span></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://www.gnu.org/software/c-intro-and-ref/manual/html_node/Old_002dStyle-Function-Definitions.html">"Old-style function definitions"</a>. <i>GNU C language</i>. 2007<span class="reference-accessdate">. Retrieved <span class="nowrap">15 November</span> 2024</span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=unknown&amp;rft.jtitle=GNU+C+language&amp;rft.atitle=Old-style+function+definitions&amp;rft.date=2007&amp;rft_id=https%3A%2F%2Fwww.gnu.org%2Fsoftware%2Fc-intro-and-ref%2Fmanual%2Fhtml_node%2FOld_002dStyle-Function-Definitions.html&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AStdarg.h" class="Z3988"></span></span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><cite id="CITEREFMichael_Kerrisk2026" class="citation web cs1">Michael Kerrisk (16 January 2026). <a rel="nofollow" class="external text" href="https://www.man7.org/linux/man-pages/man3/gnu::format.3attr.html">"gnu::format(3attr - Linux manual page"</a>. <i>man7.org</i>. man7.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=unknown&amp;rft.jtitle=man7.org&amp;rft.atitle=gnu%3A%3Aformat%283attr+-+Linux+manual+page&amp;rft.date=2026-01-16&amp;rft.au=Michael+Kerrisk&amp;rft_id=https%3A%2F%2Fwww.man7.org%2Flinux%2Fman-pages%2Fman3%2Fgnu%3A%3Aformat.3attr.html&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AStdarg.h" class="Z3988"></span></span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://gcc.gnu.org/onlinedocs/gcc-4.3.2/gcc/Function-Attributes.html#Function-Attributes">"5.27 Extensions to the C Language Family - Declaring Attributes of Functions"</a><span class="reference-accessdate">. Retrieved <span class="nowrap">2009-01-03</span></span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=unknown&amp;rft.btitle=5.27+Extensions+to+the+C+Language+Family+-+Declaring+Attributes+of+Functions&amp;rft_id=https%3A%2F%2Fgcc.gnu.org%2Fonlinedocs%2Fgcc-4.3.2%2Fgcc%2FFunction-Attributes.html%23Function-Attributes&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AStdarg.h" class="Z3988"></span></span>
</li>
<li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://www.opengroup.org/onlinepubs/007908799/xsh/varargs.h.html">"Single UNIX Specification <code>varargs.h</code>"</a><span class="reference-accessdate">. Retrieved <span class="nowrap">2007-08-01</span></span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=unknown&amp;rft.btitle=Single+UNIX+Specification+%3Ccode%3Evarargs.h%3C%2Fcode%3E&amp;rft_id=http%3A%2F%2Fwww.opengroup.org%2Fonlinepubs%2F007908799%2Fxsh%2Fvarargs.h.html&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AStdarg.h" class="Z3988"></span></span>
</li>
</ol></div></div>
<div class="navbox-styles"><style data-mw-deduplicate="TemplateStyles:r1314944253">
/* start https://en.wikipedia.org/ */


.mw-parser-output .navbox{box-sizing:border-box;border:1px solid #a2a9b1;width:100%;clear:both;font-size:88%;text-align:center;padding:1px;margin:1em auto 0}.mw-parser-output .navbox .navbox{margin-top:0}.mw-parser-output .navbox+.navbox,.mw-parser-output .navbox+.navbox-styles+.navbox{margin-top:-1px}.mw-parser-output .navbox-inner,.mw-parser-output .navbox-subgroup{width:100%}.mw-parser-output .navbox-group,.mw-parser-output .navbox-title,.mw-parser-output .navbox-abovebelow{padding:0.25em 1em;line-height:1.5em;text-align:center}.mw-parser-output .navbox-group{white-space:nowrap;text-align:right}.mw-parser-output .navbox,.mw-parser-output .navbox-subgroup{background-color:#fdfdfd;color:inherit}.mw-parser-output .navbox-list{line-height:1.5em;border-color:#fdfdfd}.mw-parser-output .navbox-list-with-group{text-align:left;border-left-width:2px;border-left-style:solid}.mw-parser-output tr+tr>.navbox-abovebelow,.mw-parser-output tr+tr>.navbox-group,.mw-parser-output tr+tr>.navbox-image,.mw-parser-output tr+tr>.navbox-list{border-top:2px solid #fdfdfd}.mw-parser-output .navbox-title{background-color:#ccf;color:inherit}.mw-parser-output .navbox-abovebelow,.mw-parser-output .navbox-group,.mw-parser-output .navbox-subgroup .navbox-title{background-color:#ddf;color:inherit}.mw-parser-output .navbox-subgroup .navbox-group,.mw-parser-output .navbox-subgroup .navbox-abovebelow{background-color:#e6e6ff;color:inherit}.mw-parser-output .navbox-even{background-color:#f7f7f7;color:inherit}.mw-parser-output .navbox-odd{background-color:transparent;color:inherit}.mw-parser-output .navbox .hlist td dl,.mw-parser-output .navbox .hlist td ol,.mw-parser-output .navbox .hlist td ul,.mw-parser-output .navbox td.hlist dl,.mw-parser-output .navbox td.hlist ol,.mw-parser-output .navbox td.hlist ul{padding:0.125em 0}.mw-parser-output .navbox .navbar{display:block;font-size:100%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em}body.skin--responsive .mw-parser-output .navbox-image img{max-width:none!important}@media print{body.ns-0 .mw-parser-output .navbox{display:none!important}}


/* end   https://en.wikipedia.org/ */
</style></div><div role="navigation" class="navbox" aria-labelledby="C_programming_language2700" style="padding:3px"><table class="nowraplinks hlist mw-collapsible expanded navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="col" class="navbox-title" colspan="2"><div id="C_programming_language2700" style="font-size:114%;margin:0 4em"><a href="C_(programming_language)" title="C (programming language)">C programming language</a></div></th></tr><tr><td class="navbox-abovebelow" colspan="2"><div>
<ul><li><a href="ANSI_C" title="ANSI C">ANSI C</a></li>
<li><a href="C99" title="C99">C99</a></li>
<li><a href="C11_(C_standard_revision)" title="C11 (C standard revision)">C11</a></li>
<li><a href="C17_(C_standard_revision)" title="C17 (C standard revision)">C17</a></li>
<li><a href="C23_(C_standard_revision)" title="C23 (C standard revision)">C23</a></li>
<li><a href="C2Y_(C_standard_revision)" title="C2Y (C standard revision)">C2Y</a></li>
<li><a href="Embedded_C" title="Embedded C">Embedded C</a></li>
<li><a href="MISRA_C" title="MISRA C">MISRA C</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Features</th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Subroutine" class="mw-redirect" title="Subroutine">Functions</a></li>
<li><a href="Include_directive#C" title="Include directive">Header files</a></li>
<li><a href="Operators_in_C_and_C%2B%2B" title="Operators in C and C++">Operators</a></li>
<li><a href="C_string_handling" title="C string handling">String</a></li>
<li><a href="C_syntax" title="C syntax">Syntax</a></li>
<li><a href="C_preprocessor" title="C preprocessor">Preprocessor</a></li>
<li><a href="C_data_types" title="C data types">Data types</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="C_standard_library" title="C standard library">Standard library</a></th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em"></div><table class="nowraplinks navbox-subgroup" style="border-spacing:0"><tbody><tr><td colspan="2" class="navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="C_character_classification" title="C character classification">Char</a></li>
<li><a href="C_file_input/output" title="C file input/output">File I/O</a></li>
<li><a href="C_mathematical_functions" title="C mathematical functions">Math</a></li>
<li><a href="C_dynamic_memory_allocation" title="C dynamic memory allocation">Dynamic memory</a></li>
<li><a href="C_string_handling" title="C string handling">String</a></li>
<li><a href="C_date_and_time_functions" title="C date and time functions">Time</a></li>
<li><a class="mw-selflink selflink">Variadic</a></li>
<li><a href="C_POSIX_library" title="C POSIX library">POSIX</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Implementations</th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Bionic_(software)" title="Bionic (software)">Bionic</a>
<ul><li><a href="Hybris_(software)" class="mw-redirect" title="Hybris (software)">libhybris</a></li></ul></li>
<li><a href="Dietlibc" title="Dietlibc">dietlibc</a></li>
<li><a href="Glibc" title="Glibc">glibc</a>
<ul><li><a href="Embedded_GLIBC" class="mw-redirect" title="Embedded GLIBC">EGLIBC</a></li></ul></li>
<li><a href="Klibc" title="Klibc">klibc</a></li>
<li><a href="Microsoft_Windows_library_files" title="Microsoft Windows library files">Windows CRT</a></li>
<li><a href="Musl" title="Musl">musl</a></li>
<li><a href="Newlib" title="Newlib">Newlib</a></li>
<li><a href="UClibc" title="UClibc">uClibc</a></li></ul>
</div></td></tr></tbody></table><div></div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="List_of_C_compilers" class="mw-redirect" title="List of C compilers">Compilers</a></th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Amsterdam_Compiler_Kit" title="Amsterdam Compiler Kit">ACK</a></li>
<li><a href="Borland_Turbo_C" class="mw-redirect" title="Borland Turbo C">Borland Turbo C</a></li>
<li><a href="Clang" title="Clang">Clang</a></li>
<li><a href="Comeau_C/C%2B%2B" title="Comeau C/C++">Comeau C/C++</a></li>
<li><a href="CompCert" title="CompCert">CompCert</a></li>
<li><a href="GNU_Compiler_Collection" title="GNU Compiler Collection">GCC</a></li>
<li><a href="IAR_Systems#IAR_Embedded_Workbench" title="IAR Systems">IAR Embedded Workbench</a></li>
<li><a href="Intel_C%2B%2B_Compiler" title="Intel C++ Compiler">ICC</a></li>
<li><a href="LCC_(compiler)" title="LCC (compiler)">LCC</a></li>
<li><a href="Norcroft_C_compiler" title="Norcroft C compiler">Norcroft C</a></li>
<li><a href="Portable_C_Compiler" title="Portable C Compiler">PCC</a></li>
<li><a href="Small_Device_C_Compiler" title="Small Device C Compiler">SDCC</a></li>
<li><a href="Tiny_C_Compiler" title="Tiny C Compiler">TCC</a></li>
<li><a href="Microsoft_Visual_C%2B%2B" title="Microsoft Visual C++">Visual C++ (MSVC)</a></li>
<li><a href="Watcom_C/C%2B%2B" title="Watcom C/C++">Watcom C/C++</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="Integrated_development_environment" title="Integrated development environment">IDEs</a></th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Anjuta" title="Anjuta">Anjuta</a></li>
<li><a href="CLion" class="mw-redirect" title="CLion">CLion</a></li>
<li><a href="Code%3A%3ABlocks" title="Code::Blocks">Code::Blocks</a></li>
<li><a href="CodeLite" title="CodeLite">CodeLite</a></li>
<li><a href="Eclipse_(software)" title="Eclipse (software)">Eclipse</a></li>
<li><a href="Geany" title="Geany">Geany</a></li>
<li><a href="GNOME_Builder" title="GNOME Builder">GNOME Builder</a></li>
<li><a href="KDevelop" title="KDevelop">KDevelop</a></li>
<li><a href="NetBeans" title="NetBeans">NetBeans</a></li>
<li><a href="Visual_Studio" title="Visual Studio">Visual Studio</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Comparison with<br>other languages</th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Compatibility_of_C_and_C%2B%2B" title="Compatibility of C and C++">Compatibility of C and C++</a></li>
<li><a href="Comparison_of_Pascal_and_C" title="Comparison of Pascal and C">Comparison with Pascal</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Descendant<br>languages</th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Alef_(programming_language)" title="Alef (programming language)">Alef</a></li>
<li><a href="C%2B%2B" title="C++">C++</a></li>
<li><a href="C_Sharp_(programming_language)" title="C Sharp (programming language)">C#</a></li>
<li><a href="D_(programming_language)" title="D (programming language)">D</a></li>
<li><a href="Objective-C" title="Objective-C">Objective-C</a></li>
<li><a href="Go_(programming_language)" title="Go (programming language)">Go</a></li>
<li><a href="Vala_(programming_language)" title="Vala (programming language)">Vala</a></li>
<li><a href="Zig_(programming_language)" title="Zig (programming language)">Zig</a></li></ul>
</div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Designer</th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em">
<ul><li><a href="Dennis_Ritchie" title="Dennis Ritchie">Dennis Ritchie</a></li></ul>
</div></td></tr><tr><td class="navbox-abovebelow" colspan="2"><div>
<ul><li><span class="noviewer" typeof="mw:File"><span title="Category"><img alt="" src="./_assets_/c8f24dc75f9c782269c846c9b17e400f/Symbol_category_class.svg.png" decoding="async" width="16" height="16" class="mw-file-element" data-file-width="180" data-file-height="185" loading="lazy"></span></span> <b>Category</b></li></ul>
</div></td></tr></tbody></table></div></div><!--htdig_noindex--><div><div class="zim-footer">
    This article is issued from <a class="external text" title="Last edited on 2026-02-04" href="https://en.wikipedia.org/wiki/?title=Stdarg.h&amp;oldid=1336648599">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
            </div>
          </main>
        </div>
      </div>
    </div>
     <script src="./_webp_/webpHandler.js"></script>
  

</body></html>