Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2022-05-22 15:35:59


> I did however not know that GCC doesn't warn on NULL. Interesting
> compromise, even though I don't quite see the point of it.
>
> Clang does warn on NULL, however.

I do see the point of it now. Under GCC the warning is pragmatically
intended to catch actual mistakes such as mistyping

    while( *p != 0 )

as

    while( p != 0 )

so the warning only triggers on the actual 0, and is enabled under
C++03 as well.

Clang, and the various static analysis tools such as the MS analyzer,
enforce a stylistic preference for nullptr, so they warn on both 0
and NULL, but Clang doesn't warn in C++03 mode.

Either way, I'm not looking forward to adding a bunch of lines to
suppress the various warnings, instead of just telling the PR author
to use BOOST_NULLPTR instead of nullptr.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk