Re: !foo vs foo == nil
Re: !foo vs foo == nil
- Subject: Re: !foo vs foo == nil
- From: "Clark Cox" <email@hidden>
- Date: Thu, 21 Aug 2008 17:08:50 -0700
On Thu, Aug 21, 2008 at 4:49 PM, Scott Ribe <email@hidden> wrote:
>> The "except as previously specified" in 6.3.2.3 5 refers back to
>> 6.3.2.3 3. Without the "except as previously specified", 6.3.2.3 5
>> would directly contradict 6.3.2.3 3 (i.e. it would render the
>> conversion from a null pointer constant to a null pointer undefined).
>
> Right. But I'm talking about "except as previously specified" in 6.3.2.3
> *6*, which refers to absolutely nothing.
>From 6.3.1.2:
"1 When any scalar value is converted to_Bool, the result is 0 if the
value compares equal to 0; otherwise, the result is 1."
_Bool is the one integer type that has a non implementation-defined
conversion from pointer types. Without the "except as previously
specified", 6.3.1.2 1 and 6.3.2.3 6 would contradict each other.
--
Clark S. Cox III
email@hidden
_______________________________________________
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