Detect misuses of NULL
|Reported by:||Even Rouault||Owned by:||Even Rouault|
If using C++11 nullptr, gcc has a -Wzero-as-null-pointer-constant switch to detect misuses of nullptr.
For now as we haven't switched to C++11, I've implemented a hack that "#define NULL nullptr" when NULL_AS_NULLPTR is defined. This uncovers misues of NULL vs FALSE, or 0 vs NULL.
In a later stage, we could replace all NULL uses in C++ files with nullptr and #define nullptr NULL for non C++11 compilers while we keep C++03 compatibility.