<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to VarArgs</title><link>https://sourceforge.net/p/typp/wiki/VarArgs/</link><description>Recent changes to VarArgs</description><atom:link href="https://sourceforge.net/p/typp/wiki/VarArgs/feed" rel="self"/><language>en</language><lastBuildDate>Thu, 07 Jan 2016 11:30:19 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/typp/wiki/VarArgs/feed" rel="self" type="application/rss+xml"/><item><title>VarArgs modified by Cyder</title><link>https://sourceforge.net/p/typp/wiki/VarArgs/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;strong&gt;VarArgs&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Config: &lt;code&gt;#define TPP_CONFIG_HAVE___VA_ARGS__ 0/1&lt;/code&gt;&lt;br/&gt;
Check: &lt;code&gt;#if __has_feature(tpp_va_args) || __has_extension(tpp_va_args)&lt;/code&gt;&lt;br/&gt;
Function: &lt;code&gt;tpp.c: _TPPLexer_CreateExpandedMacroFunction&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Tpp allows macros to be defined with variadic arguments. See the syntax showcase below for detail.&lt;br/&gt;
The &lt;code&gt;__VA_ARGS__&lt;/code&gt; Identifier may not be used as parameter for functions&lt;/p&gt;
&lt;p&gt;Hint: As fallback for invalid macro function calls, tpp always considers every function as a variadic function, but will only utter a too many arguments warning, if the function isn't declared as variadic.&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;#define v_args(func,...) func(__VA_ARGS__)

// NOTE: The following line will not yield a warning
//       due to the relaxed argument rules of TPP (s.a. The page for Macros)
v_args()          // Expands to [(][)]
v_args(foo)       // Expands to [foo][(][)]
v_args(foo,10)    // Expands to [foo][(][10][)]
v_args(foo,10,20) // Expands to [foo][(][10][,][20][)]
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;s.a. &lt;span&gt;[Macros]&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Cyder</dc:creator><pubDate>Thu, 07 Jan 2016 11:30:19 -0000</pubDate><guid>https://sourceforge.netca441fb00c498aa38db47b85c6e800557430e3d8</guid></item></channel></rss>