Am 21.08.2008 um 13:25 schrieb Chris Holloway:

If you look at section 7.17 of ISO/IEC 9899:1999, then it states that
NULL is a macro which "expands to an implementation-defined null
pointer constant". So, what is a null pointer constant? Section
6.3.2.3 states that "An integer constant expression with the value 0,
or such an expression cast to type void *, is called a null pointer
constant". So, in order for NULL to satisfy the requirement of being a
null pointer constant, it must be either 0 or (void *)0 (as Michael
stated), and hence (int)NULL is guaranteed to be 0.

What I meant was, as you noted correctly, that the memory pattern of an NULL pointer is not necessary sizeof( void * ) bytes containing 0x00. Obviously I overlooked that the standard guarantees the conversion NULL => int results in 0 and vice versa.

Regards,
        Tom_E

_______________________________________________

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]

Reply via email to