<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - Missing 'null passed to a callee that requires a non-null argument' warning for block expression invocations"
href="https://llvm.org/bugs/show_bug.cgi?id=23146">23146</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Missing 'null passed to a callee that requires a non-null argument' warning for block expression invocations
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>thonermann@coverity.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Assertion failure parsing block expressions with nonnull attributes"
href="show_bug.cgi?id=23117">Bug 23117</a> fixed (in r234297) an assertion failure that occurred when nonnull
attributes appertain to block declarations. Warnings are issued when invoking
a block with a null argument for a block with a corresponding nonnull parameter
when the attribute is explicitly specified for a block pointer type, but not
for block invocations on block expressions that specify the attribute. In the
following example, a warning is emitted for the invocation of bp(0), but not
for the block expression invocation.
$ cat t.c
void(^bp)(int *) __attribute__((nonnull(1)));
void f() {
bp(0); // expected-warning{{null passed to a callee that requires a
non-null argument}}
^(int *p1) __attribute__((nonnull(1))) {}(0); // expected-warning{{null
passed to a callee that requires a non-null argument}}
}
$ clang -fblocks -c t.c
t.c:3:9: warning: null passed to a callee that requires a non-null argument
[-Wnonnull]
bp(0);
~^
1 warning generated.</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>