Re: NSMutableArray count causes EXC_BAD_ACCESS
Re: NSMutableArray count causes EXC_BAD_ACCESS
- Subject: Re: NSMutableArray count causes EXC_BAD_ACCESS
- From: Christiaan Hofman <email@hidden>
- Date: Mon, 16 Aug 2010 10:58:34 +0200
On Aug 16, 2010, at 2:47, Chris Suter wrote: Hi Christian,
On Mon, Aug 16, 2010 at 10:30 AM, Christiaan Hofman <email@hidden> wrote:
In a sense, those ARE %lu and %ld, because it's ALWAYS true that NSUInteger=unsigned long and NSInteger=long, at least on the currently existing systems on which Mac OSX runs (both 32 and 64 bits, PPC or Intel).
Well, actually NSUInteger is "unsigned int" on 32-bit systems and "unsigned long" on 64-bit systems which is why you need the cast and why the "l" modifier wouldn't suit.
Yes, nominally, but unsigned int and unsigned long are essentially the same on 32-bits: they're both 32 bits with the same memory layout on any supported system. So the use of the format makes no difference, also in this case. That's my point.
Christiaan Incidentally, everybody should be building with "-Wall" (which includes "-Wformat") and in that case the compiler would have caught the bug.
Kind regards,
Chris
|
_______________________________________________
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