This is an archive of the discontinued LLVM Phabricator instance.

[clang] Fix printf check for CFIndex
ClosedPublic

Authored by alexander-shaposhnikov on Jun 21 2017, 9:12 PM.

Details

Summary

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.

Test plan: make check-all

Diff Detail

Repository
rL LLVM

Event Timeline

alexander-shaposhnikov edited the summary of this revision. (Show Details)
alexander-shaposhnikov planned changes to this revision.Jun 22 2017, 12:00 AM

ignore this diff for now, i will update it soon.

alexander-shaposhnikov edited the summary of this revision. (Show Details)Jun 22 2017, 3:34 AM
ahatanak accepted this revision.Jun 26 2017, 12:09 AM

This looks correct to me. The commit log of the original commit (r163266) doesn't say that CFIndex has been dropped intentionally, so this should be fine.

This revision is now accepted and ready to land.Jun 26 2017, 12:09 AM
This revision was automatically updated to reflect the committed changes.