[vtk-developers] C++ NULL definition (was: Request for a gentler tone in commit message verbiage...)

Brad King brad.king at kitware.com
Thu Apr 30 10:26:19 EDT 2015


On 04/30/2015 10:20 AM, Robert Maynard wrote:
> Actually the definition of NULL is left up to each compiler. The C++11
> draft states "The macro NULL < snip> is an implementation-defined C++
> null pointer constant"

C++98 18.1/4 says it is implementation defined but has a footnote
that does not leave much room:

 180) Possible definitions include 0 and 0L, but not (void*)0.

The reason plain C's "((void*)0)" does not work in C++ is because
C++ is strict about pointer conversions where C is tolerant.

-Brad



More information about the vtk-developers mailing list