[cfe-commits] r105680 - in /cfe/trunk: include/clang/Analysis/Analyses/PrintfFormatString.h lib/Analysis/PrintfFormatString.cpp lib/Sema/SemaChecking.cpp test/Sema/format-strings-fixit.c

Tom Care tcare at apple.com
Tue Jun 8 21:56:40 PDT 2010


Good point. Now that I think about it, checking if the flags are invalid shouldn't be much more code. I'll look at the spec and commit a fix.

Thanks,

Tom

On 08/06/2010, at 9:37 PM, Ted Kremenek wrote:

> 
> On Jun 8, 2010, at 9:11 PM, Tom Care wrote:
> 
>> Author: tcare
>> Date: Tue Jun  8 23:11:11 2010
>> New Revision: 105680
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=105680&view=rev
>> Log:
>> Added FixIt support to printf format string checking.
>> - Refactored LengthModifier to be a class.
>> - Added toString methods in all member classes of FormatSpecifier.
>> - FixIt suggestions keep user specified flags unless incorrect.
>> 
>> Limitations:
>> - The suggestions are not conversion specifier sensitive. For example, if we have a 'pad with zeroes' flag, and the correction is a string conversion specifier, we do not remove the flag. Clang will warn us on the next compilation.
> 
> Hi Tom,
> 
> Wouldn't it be better just not to do a fixit in such cases (under "Limitations")?  I'd rather we leave the code "broken" in the original form then have it "broken" in a form the programmer didn't write.  We should only change the code if it will actually make it correct.
> 
> Ted

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20100608/83cf563d/attachment.html>


More information about the cfe-commits mailing list