]> granicus.if.org Git - clang/commit
Format strings: correct signedness if already correcting width (%d,%u).
authorJordan Rose <jordan_rose@apple.com>
Thu, 17 Jan 2013 18:47:16 +0000 (18:47 +0000)
committerJordan Rose <jordan_rose@apple.com>
Thu, 17 Jan 2013 18:47:16 +0000 (18:47 +0000)
commit242ae3d6805185fcb4fd45e96af5beba93e3532c
treeca28f50c979f0895ee2fa893654c8de51e32069f
parentc8145bbab03caba4b7ef5540727487529c7effeb
Format strings: correct signedness if already correcting width (%d,%u).

It is valid to do this:
  printf("%u", (int)x);

But if we see this:
  printf("%lu", (int)x);

...our fixit should suggest %d, not %u.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172739 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/PrintfFormatString.cpp
test/FixIt/format-darwin.m
test/FixIt/format.m