<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:jonathan.sauer@gmx.de" title="jonathan.sauer@gmx.de">jonathan.sauer@gmx.de</a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - illegal hardware instruction emitted"
href="http://llvm.org/bugs/show_bug.cgi?id=18558">bug 18558</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>NEW
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>jonathan.sauer@gmx.de
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>INVALID
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - illegal hardware instruction emitted"
href="http://llvm.org/bugs/show_bug.cgi?id=18558#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - illegal hardware instruction emitted"
href="http://llvm.org/bugs/show_bug.cgi?id=18558">bug 18558</a>
from <span class="vcard"><a class="email" href="mailto:jonathan.sauer@gmx.de" title="jonathan.sauer@gmx.de">jonathan.sauer@gmx.de</a>
</span></b>
<pre>Your code is invoking undefined behavior: N1570 (C11) §6.5.6p9:
| When two pointers are subtracted, both shall point to elements of the same
| array object, or one past the last element of the array object; the result
| is the difference of the subscripts of the two array elements.
A NULL pointer doesn't point to any array object. In C++ it's N3289 §5.7p6 and
p7.
Remove the two (char*) casts, and the code runs successfully.</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>