Re: error in using NSNumber's numberWithInt: method not flagged
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