@@ -70,6 +70,38 @@ about them. The improvements since the 3.4 release include:
- New warning `-Wabsolute-value`: Clang warns about incorrect or useless usage
of the absolute functions (`abs`, `fabsf`, etc).
- New warning `-Wtautological-pointer-compare`:
.. code-block:: c++
#include <stddef.h>
void foo() {
int arr[5];
int x;
// warn on these conditionals
if (foo);
if (arr);
if (&x);
if (foo == NULL);
if (arr == NULL);
if (&x == NULL);
}
returns
`warning: comparison of address of 'x' equal to a null pointer is always false [-Wtautological-pointer-compare]`
- New warning `-Wtautological-undefined-compare`:
.. code-block:: c++
#include <stddef.h>
void f(int &x) {
if (&x == nullptr) { }
}
returns
`warning: reference cannot be bound to dereferenced null pointer in well-defined C++ code; comparison may be assumed to always evaluate to false [-Wtautological-undefined-compare]`