On Thu, Aug 21, 2008 at 12:16 PM, Clark Cox <[EMAIL PROTECTED]> wrote: > On Thu, Aug 21, 2008 at 11:56 AM, Scott Ribe <[EMAIL PROTECTED]> wrote: >>>> Could you tell me which part of the standard states that NULL is 0. >> >> >>> NULL *can* be 0, it isn't *necessarily* 0 >> >> >> It follows from the rules re conversions that it must be either 0, or 0 cast >> to a pointer type. > > Or an "implementation defined null pointer constant". That is, this is > perfectly legal: > > #define NULL __builtin_special_null_keyword_that_is_specific_to_my_compiler > > 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. > > 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;).
Arg, that example of a non-pointer context that GCC can warn about should have been (int i = NULL;) -- Clark S. Cox III [EMAIL PROTECTED] _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]