bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 0 vs. NULL (was: Re: Test for getaddrinfo() broken on Tru64 UNIX 5.1


From: Bruno Haible
Subject: Re: 0 vs. NULL (was: Re: Test for getaddrinfo() broken on Tru64 UNIX 5.1)
Date: Sat, 13 Oct 2007 22:45:50 +0200
User-agent: KMail/1.5.4

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.

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]