forked from OSchip/llvm-project
ec7d7f312e
Summary: Pick D42933 back up, and make NSInteger/NSUInteger with %zu/%zi specifiers on Darwin warn only in pedantic mode. The default -Wformat recently started warning for the following code because of the added support for analysis for the '%zi' specifier. NSInteger i = NSIntegerMax; NSLog(@"max NSInteger = %zi", i); The problem is that on armv7 %zi is 'long', and NSInteger is typedefed to 'int' in Foundation. We should avoid this warning as it's inconvenient to our users: it's target specific (happens only on armv7 and not arm64), and breaks their existing code. We should also silence the warning for the '%zu' specifier to ensure consistency. This is acceptable because Darwin guarantees that, despite the unfortunate choice of typedef, sizeof(size_t) == sizeof(NS[U]Integer), the warning is therefore noisy for pedantic reasons. Once this is in I'll update public documentation. Related discussion on cfe-dev: http://lists.llvm.org/pipermail/cfe-dev/2018-May/058050.html <rdar://36874921&40501559> Reviewers: ahatanak, vsapsai, alexshap, aaron.ballman, javed.absar, jfb, rjmccall Subscribers: kristof.beyls, aheejin, cfe-commits Differential Revision: https://reviews.llvm.org/D47290 llvm-svn: 335393 |
||
---|---|---|
.. | ||
Inputs | ||
atomic-property.m | ||
auto-fixit.m | ||
auto-isa-fixit.m | ||
bridge-cast-in-arc.mm | ||
bridge-in-non-arc.m | ||
dereference-addressof.c | ||
fixit-add-synthesize-to-property.m | ||
fixit-autoreleasepool.m | ||
fixit-availability.c | ||
fixit-availability.mm | ||
fixit-c90.c | ||
fixit-class-method-messaging.m | ||
fixit-cxx0x.cpp | ||
fixit-cxx1y-compat.cpp | ||
fixit-cxx11-attributes.cpp | ||
fixit-cxx11-compat.cpp | ||
fixit-eof-space.c | ||
fixit-errors-1.c | ||
fixit-errors.c | ||
fixit-format-darwin.m | ||
fixit-format-ios-nopedantic.m | ||
fixit-format-ios.m | ||
fixit-function-call.cpp | ||
fixit-include.c | ||
fixit-include.h | ||
fixit-interface-as-param.m | ||
fixit-large-file.cpp | ||
fixit-missing-method-return-type.m | ||
fixit-missing-self-in-block.m | ||
fixit-multiple-selector-warnings.m | ||
fixit-newline-style.c | ||
fixit-nsstring-compare.m | ||
fixit-nullability-declspec.cpp | ||
fixit-objc-arc.m | ||
fixit-objc-bridge-related-attr.m | ||
fixit-objc-bridge-related-property.m | ||
fixit-objc-bridge-related.m | ||
fixit-objc-message-comma-separator.m | ||
fixit-objc-message.m | ||
fixit-objc.m | ||
fixit-pmem.cpp | ||
fixit-pragma-attribute.c | ||
fixit-pragma-attribute.cpp | ||
fixit-pragma-pack.c | ||
fixit-recompile.c | ||
fixit-recursive-block.c | ||
fixit-static-object-decl.m | ||
fixit-suffix.c | ||
fixit-typedef-instead-of-typename-typo.cpp | ||
fixit-unicode-with-utf8-output.c | ||
fixit-unicode.c | ||
fixit-uninit.c | ||
fixit-unrecoverable.c | ||
fixit-unrecoverable.cpp | ||
fixit-vexing-parse-cxx0x.cpp | ||
fixit-vexing-parse.cpp | ||
fixit.c | ||
fixit.cpp | ||
format-darwin.m | ||
format-no-fixit.m | ||
format.m | ||
format.mm | ||
messages.cpp | ||
multiarg-selector-fixit.m | ||
no-diagnostics-fixit-info.c | ||
no-fixit.cpp | ||
no-macro-fixit.c | ||
no-typo.c | ||
nullability.mm | ||
objc-literals.m | ||
property-access-fixit.m | ||
selector-fixit.m | ||
typo-crash.cpp | ||
typo-crash.m | ||
typo-location-bugs.cpp | ||
typo-using.cpp | ||
typo.c | ||
typo.cpp | ||
typo.m |