<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:chengniansun@gmail.com" title="Chengnian Sun <chengniansun@gmail.com>"> <span class="fn">Chengnian Sun</span></a>
</span> changed
<a class="bz_bug_link
bz_status_REOPENED " title="REOPENED --- - -Wdivision-by-zero does not warn on "1000 / (unsigned char)(a << 8)"" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D22253&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=td1Y1fi2M19kkbWvL36wsj67YJZJdEUHIF3yAjJiQvQ&s=2gsw-kHn6n3qLMIZ4m52R8axmtNrOMdcIyXTynPoUew&e=">bug 22253</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>RESOLVED
</td>
<td>REOPENED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>INVALID
</td>
<td>---
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_REOPENED " title="REOPENED --- - -Wdivision-by-zero does not warn on "1000 / (unsigned char)(a << 8)"" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D22253-23c5&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=td1Y1fi2M19kkbWvL36wsj67YJZJdEUHIF3yAjJiQvQ&s=l65i9p0vIwcomNEZbBmR8gfFOEcZ5_AWszygRpOxXDY&e=">Comment # 5</a>
on <a class="bz_bug_link
bz_status_REOPENED " title="REOPENED --- - -Wdivision-by-zero does not warn on "1000 / (unsigned char)(a << 8)"" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D22253&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=td1Y1fi2M19kkbWvL36wsj67YJZJdEUHIF3yAjJiQvQ&s=2gsw-kHn6n3qLMIZ4m52R8axmtNrOMdcIyXTynPoUew&e=">bug 22253</a>
from <span class="vcard"><a class="email" href="mailto:chengniansun@gmail.com" title="Chengnian Sun <chengniansun@gmail.com>"> <span class="fn">Chengnian Sun</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=22253#c3">comment #3</a>)
<span class="quote">> (In reply to <a href="show_bug.cgi?id=22253#c2">comment #2</a>)
> > Is clang really wrong here?
> > There's no guarantte that a is zero if I recall correctly the C standard.
>
> Can you elaborate more why the expression "(unsigned char)(a << 8)" is NOT
> zero?
>
> Thanks.</span >
I did not see any undefined behavior here. The expression 'a << 8' will yield a
value of which the lowest 8 bits are 0. The cast from int to unsigned char will
only keep the lowest 8 bits.
Please correct me if I am wrong. Thanks.</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>