"Tautological pointer comparison" build failure(s)
clang 6.0
Incorrect code...
#include
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);
}
void f(int &x) {
if (&x == nullptr) { }
}
gcc with -Wall also detects some of these errors but not the one involving NULL.
Package | Version | Supposed error message | Full log |
Bug report |
blktap | 2.0.90-4 | libvhdio.c:1442:14: error: result of comparison of constant 2148012658 with expression of type 'int' is always false [-Werror,-Wtautological-constant-out-of-range-compare]
| Log |
|
cups-bjnp | 2.0.1-1 | bjnp-commands.c:187:9: error: comparison of array 'printer_id' not equal to a null pointer is always true [-Werror,-Wtautological-pointer-compare]
| Log |
|
ion | 3.2.1+dfsg-1.1 | dtnperf/dtnperf/src/dtnperf_modes/dtnperf_client.c:1959:53: error: comparison of array 'perf_opt->mon_eid' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare]
| Log |
754319
|
ipsec-tools | 1:0.8.2+20140711-10 | eaytest.c:316:6: error: comparison of array 'dnstr_w1' not equal to a null pointer is always true [-Werror,-Wtautological-pointer-compare]
| Log |
|
librcsb-core-wrapper | 1.005-5 | src/TableFile.C:357:11: error: reference cannot be bound to dereferenced null pointer in well-defined C++ code; comparison may be assumed to always evaluate to true [-Werror,-Wtautological-undefined-compare]
| Log |
|
ripmime | 1.4.0.10.debian.1-1 | mime.c:3132:37: error: comparison of array 'h->subject' not equal to a null pointer is always true [-Werror,-Wtautological-pointer-compare]
| Log |
812250
|
6 errors