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 11:35:38 +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.
Incidentally, everybody should be building with "-Wall" (which includes "-Wformat") and in that case the compiler would have caught the bug.
Kind regards,
Chris
Actually, this only warns for C API, like printf and scanf. It does not warn for Obj-C formats. It also don't see any warnings for NSLog formats when I deliberately do it wrong, using both -Wall and GCC_WARN_TYPECHECK_CALLS_TO_PRINTF.
Christiaan
|
_______________________________________________
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