• 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: error in using NSNumber's numberWithInt: method not flagged
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: error in using NSNumber's numberWithInt: method not flagged


  • Subject: Re: error in using NSNumber's numberWithInt: method not flagged
  • From: Jens Alfke <email@hidden>
  • Date: Sun, 09 Jun 2013 13:51:21 -0700

This is correct behavior. C allows casting between pointer and integer types. It’s used a lot for doing pointer arithmetic. (C’s ancestor BCPL didn’t even have separate integer and pointer types.)

You might get an optional compiler warning if the integer type narrower than a pointer, but that’s about it.

However, it makes no sense at all to cast between a pointer and a float, so that’s an error.

—Jens
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


References: 
 >error in using NSNumber's numberWithInt: method not flagged (From: Boyd Collier <email@hidden>)

  • Prev by Date: Re: error in using NSNumber's numberWithInt: method not flagged
  • Next by Date: Suggested maximum size of NSCachesDirectory on iOS
  • Previous by thread: Re: error in using NSNumber's numberWithInt: method not flagged
  • Next by thread: Suggested maximum size of NSCachesDirectory on iOS
  • Index(es):
    • Date
    • Thread