On 5 Apr 2004 06:18:31 -0700,
(Mantorok Redgormor) wrote:
>>
>> A plain zero is also a null pointer constant and can be cast to a
>> function pointer, producing a null pointer of the right type.
>>
>> > Since function pointers might have different
>> > representations than object pointers, it seems
>> > you would end up with implementation-defined
>> > behavior either way.
>>
>> No, it is defined by the C Standard.
>
>what section?
6.3.2.3/3 and 4:
3 An integer constant expression with the value 0, or such an expression
cast to type void *, is called a null pointer constant.55) If a null
pointer constant is converted to a pointer type, the resulting pointer,
called a null pointer, is guaranteed to compare unequal to a pointer to any
object or function.
4 Conversion of a null pointer to another pointer type yields a null
pointer of that type. Any two null pointers shall compare equal.
-leor
--
Leor Zolman --- BD Software ---
www.bdsoft.com
On-Site Training in C/C++, Java, Perl and Unix
C++ users: Download BD Software's free STL Error Message Decryptor at:
www.bdsoft.com/tools/stlfilt.html