Re: 4.5 and NSInteger/NSUInteger Format Specifier Warnings
Re: 4.5 and NSInteger/NSUInteger Format Specifier Warnings
- Subject: Re: 4.5 and NSInteger/NSUInteger Format Specifier Warnings
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Thu, 04 Oct 2012 07:24:38 +0700
On Oct 3, 2012, at 12:04 PM, Thomas Clement wrote:
If you're compiling for both 32 and 64-bit you should use %lu and cast to 'unsigned long'.
Thanks for that--I just figured it out a minute ago. I had changed my architecture setting to 32/64--changing it back to 32 solved the issue for now. So it seems that when trying to compile a fat binary you have to cast. What a pain.
On 3 oct. 2012, at 19:49, Keary Suska <email@hidden> wrote:
Is anyone else seeing this? I get tons of warnings such as: Format specifies type 'long' but the argument has type 'NSUInteger' (aka 'unsigned int') when using %ld as a format specifier. If, however, I change the format specifier to %d as the warning (and the fix-it) would suggest, it changes the warning to: Format specifies type 'int' but the argument has type 'long'
With this line in Xcode Build Settings:
OTHER_CFLAGS = -DNS_BUILD_32_LIKE_64=1 NS(U)Integer is (unsigned) long for both 32 and 64 Bits. So that %lu / %ld works for both without warnings without any castings.
Gerriet.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden