[cfe-commits] r140777 - in /cfe/trunk: lib/Sema/SemaChecking.cpp test/Sema/format-strings.c

Ted Kremenek kremenek at apple.com
Thu Sep 29 16:01:39 PDT 2011


This isn't just about printf and scanf, but any function with the format attribute.  There are functions with that attribute where this isn't a no-op even when the format string is empty.  I saw such a case, which was the motivation for this change.

That said, the warning definitely is useful for printf and friends when there are no data arguments.  I'd like the warning to be the strictest when it can be.

On Sep 29, 2011, at 2:25 PM, Joerg Sonnenberger wrote:

> On Thu, Sep 29, 2011 at 05:52:21AM -0000, Ted Kremenek wrote:
>> Author: kremenek
>> Date: Thu Sep 29 00:52:16 2011
>> New Revision: 140777
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=140777&view=rev
>> Log:
>> Do not warn about empty format strings when there are no data arguments.  Fixes <rdar://problem/9473155>.
> 
> Why? The point of the original warning is that the operation is
> effectively a nop.
> 
> Joerg
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list