]> granicus.if.org Git - clang/commit
Added FixIt support to printf format string checking.
authorTom Care <tcare@apple.com>
Wed, 9 Jun 2010 04:11:11 +0000 (04:11 +0000)
committerTom Care <tcare@apple.com>
Wed, 9 Jun 2010 04:11:11 +0000 (04:11 +0000)
commit3bfc5f49e0e37e235bb0d33bcbcb36af9d1f84ab
tree960b5940e2de8f95be43445f90a38040dcb0eb00
parent5a57efd7bf88a4a13018e0471ded8063a4abe8af
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.

A    test/Sema/format-strings-fixit.c
M    include/clang/Analysis/Analyses/PrintfFormatString.h
M    lib/Analysis/PrintfFormatString.cpp
M    lib/Sema/SemaChecking.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105680 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Analysis/Analyses/PrintfFormatString.h
lib/Analysis/PrintfFormatString.cpp
lib/Sema/SemaChecking.cpp
test/Sema/format-strings-fixit.c [new file with mode: 0644]