While triaging #487, I was surprised that clang would warn about
void a(void)
{
int data[1];
if (!data)
return;
}
...
warning: address of array 'data' will always evaluate to 'true' [-Wpointer-bool-conversion]
if (!data)
~^~~~
but not
#include <stddef.h>
void a(void)
{
int data[1];
if (data == NULL)
return;
}
Turns out, the second one is controlled by -Wtautological-pointer-compare, which is a sub-warning of -Wtautological-compare, which we disable in the main Makefile.
warning: comparison of array 'data' equal to a null pointer is always false [-Wtautological-pointer-compare]
if (data == NULL)
^~~~ ~~~~
This is an almost identical situation to -Wuninitialized and -Wsometimes-uninitialized (disabling one warning disables a bunch of other ones). According to the comments, it seems that it was disabled because of -Wtautological-unsigned-zero-compare so maybe that is the only one that actually needs to be disabled (if it is truly as noisy as it claims).
While triaging #487, I was surprised that clang would warn about
but not
Turns out, the second one is controlled by
-Wtautological-pointer-compare, which is a sub-warning of-Wtautological-compare, which we disable in the main Makefile.This is an almost identical situation to
-Wuninitializedand-Wsometimes-uninitialized(disabling one warning disables a bunch of other ones). According to the comments, it seems that it was disabled because of-Wtautological-unsigned-zero-compareso maybe that is the only one that actually needs to be disabled (if it is truly as noisy as it claims).