[cfe-commits] [PATCH] Teach printf warnings about small integer types.

Justin Bogner mail at justinbogner.com
Sat Oct 2 00:49:38 PDT 2010


Previously, the printf warnings would say your arguments type was
`int` when it was really a `char` or a `short`. This fixes that and
allows the hints to suggest `h` modifiers for small ints.

Typedef'd `char` types are treated as ints, since the most common case
of uint8_t shouldn't normally be formatted as a character.
---
 lib/Analysis/PrintfFormatString.cpp |   16 +++++++++++++++-
 lib/Sema/SemaChecking.cpp           |    6 ++++--
 test/Sema/format-strings.c          |   11 ++++++++++-
 3 files changed, 29 insertions(+), 4 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: informative-printf.patch
Type: text/x-diff
Size: 3369 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20101002/c3fc51d7/attachment.patch>


More information about the cfe-commits mailing list