<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - The core.NonNullParamChecker message is missing important information"
href="https://bugs.llvm.org/show_bug.cgi?id=39358">39358</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>The core.NonNullParamChecker message is missing important information
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Static Analyzer
</td>
</tr>
<tr>
<th>Assignee</th>
<td>noqnoqneo@gmail.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>alexfh@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>The core.NonNullParamChecker checker warnings now read "Null pointer passed as
an argument to a 'nonnull' parameter". In the presence of long paths, macros,
etc. the message becomes difficult to understand. It could benefit from some
disambiguating information (which parameter? what's the function name?).
I tried to produce an isolated test case similar to what I've seen in real
code, but it doesn't let one fully experience the frustration I had trying to
investigate a real case.
$ cat q.cc
#include <cstring>
#define Q(a, b, c, d, e) memcmp(a, b, e) || memcmp(c, d, e)
void f() {
char *a = nullptr;
char *b = nullptr;
char c[10];
char d[10];
if (Q(a, b, c, d, 10)) {
}
}
$ clang_tidy -checks=-*,clang-analyzer* q.cc --
1 warning generated.
q.cc:8:7: warning: Null pointer passed as an argument to a 'nonnull' parameter
[clang-analyzer-core.NonNullParamChecker]
if (Q(a, b, c, d, 10)) {
^
q.cc:2:26: note: expanded from macro 'Q'
#define Q(a, b, c, d, e) memcmp(a, b, e) || memcmp(c, d, e)
^
q.cc:4:3: note: 'a' initialized to a null pointer value
char *a = nullptr;
^
q.cc:8:7: note: Null pointer passed as an argument to a 'nonnull' parameter
if (Q(a, b, c, d, 10)) {
^
q.cc:2:26: note: expanded from macro 'Q'
#define Q(a, b, c, d, e) memcmp(a, b, e) || memcmp(c, d, e)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>