Variable arguments weirdness
<p>Ok, so this piece of code works fine in the Debug but not in Release build.</p>

<pre><code>int AddString(LPCTSTR lpszString, ...)
{
    RArray&lt;LPCTSTR&gt; strings;
    va_list args;
    va_start(args, lpszString);
    do
    {
        strings.Add(lpszString); 
    } while (lpszString = va_arg(args, LPCTSTR));
    va_end(args);

    // ... rest of code ...
}
</code></pre>

<p>It seems in Release, va_arg just returns an extra value containing rubbish. So if I pass on 3 parameters: I fetch 3 in Debug and miraculously 4 in Release... How is this possible? Using VS2010 btw.</p>

<p>(RArray is just a simple template class comparable to MFC's CArray, does not influence results)</p>

<p>Thanks!</p>

<p>Edit: I call it like this</p>

<pre><code>AddString(_T("Hello, world!"), _T("Hallo, wereld!"), _T("Hallo, Welt!"));
</code></pre>
