[patch] Warn on va_start() when called with a reference parameter

Nico Weber thakis at chromium.org
Fri May 24 16:32:53 PDT 2013


Landed in r182694 after irc lgtm. Thanks!


On Fri, May 24, 2013 at 9:54 AM, Nico Weber <thakis at chromium.org> wrote:

> On Fri, May 24, 2013 at 9:23 AM, Jordan Rose <jordan_rose at apple.com>wrote:
>
>> Your test case is named .cc (rather than .cpp) and as such is not getting
>> run...which is important because it's actually broken.
>>
>
> 9_9 Fixed, thanks.
>
>
>> All of va_start is implementation-defined behavior anyway, yes? I guess
>> it's still a good warning, though.
>>
>
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1905.pdf 18.7p3
> explicitly calls this (and some other things) out as undefined, not
> implementation-defined.
>
>
>>
>> Jordan
>>
>>
>> On May 23, 2013, at 22:07 , Nico Weber <thakis at chromium.org> wrote:
>>
>> > Hi,
>> >
>> > it's undefined behavior to call va_start() with a reference parameter.
>> It happens to work fine with clang, but blows up with other compilers (e.g.
>> msvs), so this patch adds a warning for it. It also moves 2 other existing
>> warnings behind the new -Wvarargs flag.
>> >
>> > Ok?
>> >
>> > Nico
>>
>> > _______________________________________________
>> > cfe-commits mailing list
>> > cfe-commits at cs.uiuc.edu
>> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130524/7bb1952e/attachment.html>


More information about the cfe-commits mailing list