nxtbgthng / OAuth2Client

Client library for OAuth2 (currently built against draft 10 of the OAuth2 spec)
855 stars 217 forks source link

Add an explicit cast to long in format specifier #214

Closed ttsugriy closed 6 years ago

ttsugriy commented 7 years ago

https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html suggests an explicit cast to 'long' for 32/64 bit compatibility, since on 32 bit NSInteger is int/ unsigned int and on 64bit architectures it's long/unsigned long.

New versions of clang will complain about this with following warning: Sources/OAuth2Client/NXOAuth2Connection.m:478:141: error: values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead [-Werror,-Wformat] NSString *localizedError = [NSString stringWithFormat:NSLocalizedString(@"HTTP Error: %d", @"NXOAuth2HTTPErrorDomain description"), self.statusCode]; ~~ ^~~~~~~ %ld (long) 1 error generated.

Gernot commented 6 years ago

This makes sense, thanks!