• 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 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

  • Follow-Ups:
    • Re: NSMutableArray count causes EXC_BAD_ACCESS
      • From: Chris Suter <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: Re: NSMutableArray count causes EXC_BAD_ACCESS
  • Next by Date: Using agvtool's generated version info file?
  • Previous by thread: Re: NSMutableArray count causes EXC_BAD_ACCESS
  • Next by thread: Re: NSMutableArray count causes EXC_BAD_ACCESS
  • Index(es):
    • Date
    • Thread