<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 --- - "tautological-undefined-compare" warning is not fired when dereferrenced null pointer is casted back to pointer"
href="https://llvm.org/bugs/show_bug.cgi?id=26535">26535</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>"tautological-undefined-compare" warning is not fired when dereferrenced null pointer is casted back to pointer
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>3.6
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</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>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>dmitry@dali-studio.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Here's a sample snippet:
int& get() {
return *reinterpret_cast<int*>(0); // this code is UB
}
void test() {
int* foo = &(get());
if (foo == nullptr) { // silently optimized away, no warnings
}
}
This broke existing code while migrating from 3.4 to 3.6 (Android NDK). Yes,
the above code is UB, so a warning would be nice.</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>