• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSMutableArray count causes EXC_BAD_ACCESS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >NSMutableArray count causes EXC_BAD_ACCESS (From: Andrew Gehring <email@hidden>)
 >Re: NSMutableArray count causes EXC_BAD_ACCESS (From: Mark Woollard <email@hidden>)
 >Re: NSMutableArray count causes EXC_BAD_ACCESS (From: Chris Suter <email@hidden>)
 >Re: NSMutableArray count causes EXC_BAD_ACCESS (From: Christiaan Hofman <email@hidden>)
 >Re: NSMutableArray count causes EXC_BAD_ACCESS (From: Chris Suter <email@hidden>)

  • Prev by Date: Suppressing a library link
  • Next by Date: Re: NSMutableArray count causes EXC_BAD_ACCESS
  • Previous by thread: Re: NSMutableArray count causes EXC_BAD_ACCESS
  • Next by thread: Re: NSMutableArray count causes EXC_BAD_ACCESS
  • Index(es):
    • Date
    • Thread