"Tautological pointer comparison" build failure(s)
clang 3.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 |
avian | 1.1.0-4 | src/avian/machine.h:1705:7: error: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to false [-Werror,-Wtautological-undefined-compare]
| Log |
|
bind-dyndb-ldap | 6.0-4 | ../../src/fwd_register.c:53:6: error: comparison of nonnull parameter 'fwdrp' equal to a null pointer is false on first encounter [-Werror,-Wtautological-pointer-compare]
| Log |
|
collectd | 5.4.1-6 | curl_xml.c:388:24: error: comparison of array 'vl->type_instance' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare]
| Log |
758481
|
faketime | 0.9.6-4 | libfaketime.c:513:8: error: comparison of nonnull parameter 'buf' not equal to a null pointer is true on first encounter [-Werror,-Wtautological-pointer-compare]
| Log |
|
hidrd | 0.2.0-11 | page.h:225:14: error: comparison of constant 65280 with expression of type 'hidrd_usage_page' (aka 'enum hidrd_usage_page') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
| Log |
|
ion | 3.2.1+dfsg-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-2 | eaytest.c:316:6: error: comparison of array 'dnstr_w1' not equal to a null pointer is always true [-Werror,-Wtautological-pointer-compare]
| Log |
|
libdvbpsi | 1.2.0-1 | test_dr.c:49:3: error: comparison of constant 12 with expression of type 'bool' is always true [-Werror,-Wtautological-constant-out-of-range-compare]
| Log |
|
libkqueue | 2.0.3-1.1 | src/linux/read.c:207:74: error: comparison of constant 0 with boolean expression is always false [-Werror,-Wtautological-constant-out-of-range-compare]
| Log |
729591
|
librcsb-core-wrapper | 1.005-3 | 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 |
|
ltrace | 0.7.3-4 | ltrace-elf.c:238:1: error: comparison of constant 0 with boolean expression is always false [-Werror,-Wtautological-constant-out-of-range-compare]
| Log |
|
open-vm-tools | 2:9.4.6-1770165-8 | hgfsServer.c:5630:30: error: comparison of constant 255 with expression of type 'HgfsOp' is always false [-Werror,-Wtautological-constant-out-of-range-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
|
spout | 1.4-2 | spout.c:982:25: error: comparison of constant 128 with expression of type 'char' is always true [-Werror,-Wtautological-constant-out-of-range-compare]
| Log |
812249
|
14 errors