summaryrefslogtreecommitdiffstats
path: root/clang/test/FixIt/format-darwin.m
Commit message (Collapse)AuthorAgeFilesLines
* [clang] Enable printf check for CFIndexAlexander Shaposhnikov2017-06-261-1/+22
| | | | | | | | | | | | | | 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 llvm-svn: 306343
* Temporary revert r221818 until all the problemsAnton Korobeynikov2014-11-121-2/+2
| | | | | | with objc stuff will be resolved. llvm-svn: 221829
* Now really fix the typo in the testAnton Korobeynikov2014-11-121-2/+2
| | | | llvm-svn: 221825
* Update the tests to handle proper result type of (?:)Anton Korobeynikov2014-11-121-2/+2
| | | | llvm-svn: 221824
* Format strings: check against an enum's underlying type.Jordan Rose2014-05-311-5/+29
| | | | | | | | | | | | | This allows us to be more careful when dealing with enums whose fixed underlying type requires special handling in a format string, like NSInteger. A refinement of r163266 from a year and a half ago, which added the special handling for NSInteger and friends in the first place. <rdar://problem/16616623> llvm-svn: 209966
* Fix testcase.Ted Kremenek2013-03-251-1/+1
| | | | llvm-svn: 177934
* For printf checking, handle nested typedefs for darwin-specific checking.Ted Kremenek2013-03-251-0/+8
| | | | | | Fixes <rdar://problem/13491605>. llvm-svn: 177931
* Revert "intmax_t is long long on Darwin, not long."Jordan Rose2013-02-201-23/+0
| | | | | | | | | 'long' and 'long long' are different for the purposes of mangling. This caused <rdar://problem/13254874>. This reverts commit c2f994d31ec85e9af811af38eb1b28709aef0b2c. llvm-svn: 175681
* intmax_t is long long on Darwin, not long.Jordan Rose2013-02-201-0/+23
| | | | | | <rdar://problem/11540697> llvm-svn: 175588
* Format strings: correct signedness if already correcting width (%d,%u).Jordan Rose2013-01-171-0/+18
| | | | | | | | | | | | 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. llvm-svn: 172739
* Convert test/FixIt/format-darwin.m to use relative line numbers.Jordan Rose2013-01-171-46/+42
| | | | llvm-svn: 172738
* Format strings: add more expression types that don't need parens to cast.Jordan Rose2012-12-051-1/+1
| | | | | | | No functionality change (the test change is a comment only, and the new functionality can't be tested using the current test). llvm-svn: 169399
* Format strings: offer a fixit for Darwin's %D/%U/%O to ISO %d/%u/%o.Jordan Rose2012-09-131-11/+18
| | | | | | <rdar://problem/12061922> llvm-svn: 163772
* Format strings: %D, %U, and %O are valid on Darwin (same as %d, %u, %o).Jordan Rose2012-09-131-0/+10
| | | | | | | | | These will warn under -Wformat-non-iso, and will still be rejected outright on other platforms. <rdar://problem/12061922> llvm-svn: 163771
* Format strings: suggest casts for NS(U)Integer and [SU]Int32 on Darwin.Jordan Rose2012-09-051-0/+181
These types are defined differently on 32-bit and 64-bit platforms, and trying to offer a fixit for one platform would only mess up the format string for the other. The Apple-recommended solution is to cast to a type that is known to be large enough and always use that to print the value. This should only have an impact on compile time if the format string is incorrect; in cases where the format string matches the definition on the current platform, no warning will be emitted. <rdar://problem/9135072&12164284> llvm-svn: 163266
OpenPOWER on IntegriCloud