>> I also heard that generally speaking NULL is not necessarily always >> equal to 0 on all architectures. > > > I don't believe this is the case. There can be funny issues with BOOL types, > such that BOOL == YES is an inadvisable construct, since your BOOL could be > an integer of any value.
In the C language an integral constant expression with the value 0 will always translate to a null pointer. The actual representation of a null pointer in memory may not be 0. Different pointer types may have different internal values. The compiler will know how to translate "0" to the appropriate value IF it knows the value is being used as a pointer. See http://c-faq.com/null/index.html for lots more on the subject. It explains thing like why func(x, 0) may not generate the same code as func(x, (char*) 0). Marc _______________________________________________ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com