5 ms·
Setting NULL or nullptr to any value other than 0 is highly likely to break most complex C/C++ codebases.
by devit 8y ago
Setting NULL or nullptr to any value other than 0 is highly likely to break most complex C/C++ codebases.
- cyphar 8y agoEven simple codebases that do if (!p) Anywhere would immediately cause problems.
- saagarjha 8y agoThis is legal in C, even if the representation for a null pointer is not actually "all zero bits" internally. The null pointer is defined to compare equal to 0, which is the contrapositive of what your test is doing.