<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 --- - When casting an unsigned result of ~ operator to a larger integer type, MSVC warns on that"
href="https://llvm.org/bugs/show_bug.cgi?id=26557">26557</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>When casting an unsigned result of ~ operator to a larger integer type, MSVC warns on that
</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>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ruiu@google.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>We found that when we build LLVM/Clang on a 64-bit Windows, the MSVC compiler
prints out a few warnings about possible misuses of ~ operator.
<a href="http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/29601/steps/build%20lld/logs/warnings%20%2811%29">http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/29601/steps/build%20lld/logs/warnings%20%2811%29</a>
It warns if an unsigned result of ~ is extended to a larger integer type. For
example, if you have a function f(uint64_t) and a varaible x of type uint32_t,
it warns on f(~x).
This may be useful because for example the above case is not very obvious.
Should we warn on the same thing?</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>