<html>
<head>
<base href="http://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 --- - Confusing location information of -Wunused-value warnings"
href="http://llvm.org/bugs/show_bug.cgi?id=18980">18980</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Confusing location information of -Wunused-value warnings
</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>chengniansun@gmail.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>@trunk trunk 202299
The expression (i ? pf : pv) has no side effect, and therefore the computed
value is not used. Clang indicates that "pf" is not used. But to me it seems
not complete, as "pv" is also not used.
$: cat s.c
void a(int i) {
int (*pf)[2];
int (*pv)[i + 1];
(i ? pf : pv);
}
$: clang-trunk -Wunused-value -c s.c
s.c:4:8: warning: expression result unused [-Wunused-value]
(i ? pf : pv);
^~
1 warning generated.
$: gcc-trunk -Wunused-value -c s.c
s.c: In function ‘a’:
s.c:4:3: warning: statement with no effect [-Wunused-value]
(i ? pf : pv);
^</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>