• 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: !foo vs foo == nil
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: !foo vs foo == nil


  • Subject: Re: !foo vs foo == nil
  • From: Scott Ribe <email@hidden>
  • Date: Thu, 21 Aug 2008 13:38:20 -0600
  • Thread-topic: !foo vs foo == nil

> as long as, when
> __builtin_special_null_keyword_that_is_specific_to_my_compiler is
> converted to a pointer type, it becomes a null pointer.

And, if converted to integer type, it becomes 0. Right; I was certainly
talking about standard integer/pointer types, without compiler magic, which
must be 0, not any other value. Thing is, even the special compiler keyword
is *indistinguishable* from 0, except for type checking rules.

> GCC uses such an implementation defined constant to allow additional
> warnings when NULL is used in a non-pointer context (i.e. int i = 0;).

And also, I believe, to finesse away type conflicts in C++.


--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 722-0567 voice


_______________________________________________

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

  • Follow-Ups:
    • Re: !foo vs foo == nil
      • From: "Clark Cox" <email@hidden>
References: 
 >Re: !foo vs foo == nil (From: "Clark Cox" <email@hidden>)

  • Prev by Date: Re: !foo vs foo == nil
  • Next by Date: Re: !foo vs foo == nil
  • Previous by thread: Re: !foo vs foo == nil
  • Next by thread: Re: !foo vs foo == nil
  • Index(es):
    • Date
    • Thread