• 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: Is this a bug of the Cocoa or the Objective-C?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is this a bug of the Cocoa or the Objective-C?


  • Subject: Re: Is this a bug of the Cocoa or the Objective-C?
  • From: John Stiles <email@hidden>
  • Date: Fri, 26 Jan 2007 11:29:46 -0800

This is documented already.

If the message sent to nil returns anything other than the aforementioned value types (for example, if it returns any struct type, any floating-point type, or any vector type) the return value is undefined.

"The return value is undefined," case closed.
The content of the vector structore might change in a random way, it might be entirely unchanged, it might end up all zeros. You cannot rely on any particular behavior.
In fact, you will find that on different architectures or with different compiler versions or optimization settings, the results will vary.



On Jan 26, 2007, at 11:18 AM, JongAm Park wrote:

Hmm..

Yeah.. it was documented.
However, one thing is not explained.
When it returns nil or 0, it doesn't update the NSRange variable.
I understand that a scalar value can't be assigned to a vector structure.
However, it should be explained somewhere that the content of the vector structure is not changed
when the nil value is tried to be assigned to the structure.


Thank you for the link, though.

Joar Wingfors wrote:

On Jan 26, 2007, at 5:07 PM, JongAm Park wrote:

However, it was not documented, or somewhere it was documented but I didn't read it
or I forgot it.

It's documented in a lot of places, here are two examples:

<http://developer.apple.com/documentation/MacOSX/Conceptual/ universal_binary/universal_binary_tips/chapter_5_section_22.html>
<http://developer.apple.com/documentation/Cocoa/Conceptual/ ObjectiveC/Articles/chapter_4_section_3.html>


It would be good if the Objective-C runtime can check if the scalar value, i.e nil, is
tried to be assigned to the NSRange, ie. a vector structure, and can raise some exception.

File enhancement requests.

j o a r




_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
40blizzard.com


This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >Is this a bug of the Cocoa or the Objective-C? (From: JongAm Park <email@hidden>)
 >Re: Is this a bug of the Cocoa or the Objective-C? (From: Nick Zitzmann <email@hidden>)
 >Re: Is this a bug of the Cocoa or the Objective-C? (From: JongAm Park <email@hidden>)
 >Re: Is this a bug of the Cocoa or the Objective-C? (From: Joar Wingfors <email@hidden>)
 >Re: Is this a bug of the Cocoa or the Objective-C? (From: JongAm Park <email@hidden>)

  • Prev by Date: Re: Is this a bug of the Cocoa or the Objective-C?
  • Next by Date: Re: Mouse & keyboard inactivity
  • Previous by thread: Re: Is this a bug of the Cocoa or the Objective-C?
  • Next by thread: Re: Is this a bug of the Cocoa or the Objective-C?
  • Index(es):
    • Date
    • Thread