[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

Ted Kremenek kremenek at apple.com
Tue Jun 8 21:37:31 PDT 2010


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/18847443/attachment.html>


More information about the cfe-commits mailing list