-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Bruno Haible wrote:
> Ben Pfaff wrote:
>> ISO C says that NULL can be defined as 0, without a cast to void
>> *, and it is always defined that way in C++.
> 
> The latter statement is not true. ISO C++ 18.1.(3) says:
> 
>   "The macro NULL is an implementation-defined C++ null pointer constant
>    in this International Standard (4.10)."
> with footnote:
>   "Possible definitions include 0 and 0L, but not (void*)0."
> 
> and g++ defines NULL to __null. The differences between NULL and 0 in g++
> are least:
>   - sizeof (NULL) == sizeof (void*),
>   - sin (NULL) gives a warning, sin (0) does not.

So it could be something besides 0 or 0L. But I'm pretty sure Ben's
point was that it is not safe to assume that using NULL, addresses those
argument-passing problems, as you claimed (that is, it may be defined as
just 0 or another type that is not compatible with (void*)). To be
portable, it must be cast when passed as a vararg param.

- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHEWfe7M8hyUobTrERCAKVAKCKw1ES8cc4hLKbBBrV0VThXc3qVgCfRlbl
udvr5wlLCmtfV+7TNgO6Ans=
=wg6o
-----END PGP SIGNATURE-----


Reply via email to