[cfe-commits] [patch] -Wformat fixup for vprintf (and friends)

Jean-Daniel Dupas devlists at shadowlab.org
Tue Feb 21 11:59:45 PST 2012


Le 21 févr. 2012 à 20:53, Ted Kremenek a écrit :

> 
> On Feb 21, 2012, at 10:32 AM, Jean-Daniel Dupas <devlists at shadowlab.org> wrote:
> 
>> Thanks,
>> 
>> What do you mean by "the right thing".
>> 
>> In the C test, the function check_string_literal2() test that the warning does not trigger when the user forward a format string argument.
>> 
>> In the C++ test, the "int Foo::printf(const char *fmt, …)" contains a case with vprintf() and no warning, and finally, the objc test case contains a similar test (+ [Bar log2:(NSString *)fmt] ) with NSLogv().
>> 
> 
> Those are great tests.  I was just talking about the obvious case.  Here your patch introduces the following test change:
> 
> -  vprintf(s,ap); // // no-warning
> +  vprintf(s,ap); // expected-warning {{format string is not a string literal}}
> 
> I'm just asking for a test case that shows vprintf being called with a string literal and the warning not firing, etc.
> Yes I know this should work, but our tests should reflect that.  I did another scan of our tests, and it looks like we have such a test case.  So I think this patch is good as is.


OK. Thank you for the review.

-- Jean-Daniel




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120221/0c222fac/attachment.html>


More information about the cfe-commits mailing list