]> granicus.if.org Git - clang/commit
[clang] Enable printf check for CFIndex
authorAlexander Shaposhnikov <shal1t712@gmail.com>
Mon, 26 Jun 2017 23:02:27 +0000 (23:02 +0000)
committerAlexander Shaposhnikov <shal1t712@gmail.com>
Mon, 26 Jun 2017 23:02:27 +0000 (23:02 +0000)
commit3cbedc8c4aaccac10f1256db4f49d7f5cd27327e
treeff7c0d07254994511ded1aba28d894e0024860a5
parent6cfb5bf41823be28bca09fe72dd3d4b83f4e1be8
[clang] Enable printf check for CFIndex

According to
https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html
CFIndex and NSInteger should be treated the same way (see the section Platform Dependencies).
This diff changes the function shouldNotPrintDirectly in SemaChecking.cpp accordingly
and adds tests for the "fixit" and the warning.

Differential revision: https://reviews.llvm.org/D34496

Test plan: make check-all

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