<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 --- - unsafe mix of type 'bool' and type 'unsigned __int64' in DebugInfo & StringRef"
href="http://llvm.org/bugs/show_bug.cgi?id=21158">21158</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>unsafe mix of type 'bool' and type 'unsigned __int64' in DebugInfo & StringRef
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</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>yaron.keren@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>With trunk r219051 Visual C++ warns:
C:\llvm-clean\include\llvm/ADT/StringRef.h(351): warning C4805: '!=' : unsafe
mix of type 'bool' and type 'unsigned __int64' in operation
(..\..\..\lib\Analysis\ModuleDebugInfoPrinter.cpp)
[C:\llvm-clean\msvc\lib\Analysis\LLVMAnalysis.vcxproj]
C:\llvm-clean\include\llvm/IR/DebugInfo.h(200) : see reference to
function template instantiation 'bool llvm::Stri
ngRef::getAsInteger<T>(unsigned int,T &) const' being compiled
with
[
T=bool
]
C:\llvm-clean\include\llvm/IR/DebugInfo.h(554) : see reference to
function template instantiation 'T llvm::DIDescr
iptor::getHeaderFieldAs<bool>(unsigned int) const' being compiled
with
[
T=bool
]
the warning may have merit, when getHeaderFieldAs<bool> instantiates
getAsInteger with T=bool ,the comparison logic
static_cast<T>(ULLVal) != ULLVal)
which for integers checks if the ULLVal fits in a T sized integer will work
somewhat differently for a bool. It will check if ULLVal was 0 or 1 and if not
return an error code. This in incosistent with the usual C++ assumption that
any non-zero is true.</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>