From 3c3111d3aefe907c8c0f0e933029608d96ceefeb Mon Sep 17 00:00:00 2001 From: Mark Mentovai Date: Sun, 23 Jul 2017 21:05:55 -0400 Subject: Cast NSInteger to long for formatting as %ld MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In https://crbug.com/747643, a new version of Clang produces warnings when attempting to format NSInteger as %zd (which is normally used for ssize_t). Acquiesce by casting NSInteger to long and formatting using %ld. In the process, I audited all occurrences of %zd in GTM and found that the remainder were being used to format size_t, which ought to use %zu, so I’ve corrected those. I also audited the existing uses of %zu and found them all to be correct. --- UnitTesting/GTMSenTestCase.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'UnitTesting') diff --git a/UnitTesting/GTMSenTestCase.h b/UnitTesting/GTMSenTestCase.h index 0bec7a6..00d8dc4 100644 --- a/UnitTesting/GTMSenTestCase.h +++ b/UnitTesting/GTMSenTestCase.h @@ -223,7 +223,7 @@ } else if (![_a2value isKindOfClass:[NSString class]]) { \ _failure = [NSString stringWithFormat:@"(%@) is not an NSString* (%@)", @#a2, [_a2value class]]; \ } else if ((_result = [_a1value compare:_a2value]) != NSOrderedSame) { \ - _failure = [NSString stringWithFormat:@"(%@) vs (%@) == %zd", _a1value, _a2value, (long)_result]; \ + _failure = [NSString stringWithFormat:@"(%@) vs (%@) == %ld", _a1value, _a2value, (long)_result]; \ } \ } \ @catch (NSException *_exception) { \ @@ -263,7 +263,7 @@ } else if (![_a2value isKindOfClass:[NSString class]]) { \ _failure = [NSString stringWithFormat:@"(%@) is not an NSString* (%@)", @#a2, [_a2value class]]; \ } else if ((_result = [_a1value compare:_a2value]) == NSOrderedSame) { \ - _failure = [NSString stringWithFormat:@"(%@) vs (%@) == %zd", _a1value, _a2value, _result]; \ + _failure = [NSString stringWithFormat:@"(%@) vs (%@) == %ld", _a1value, _a2value, (long)_result]; \ } \ } \ @catch (NSException *_exception) { \ -- cgit v1.2.3