<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - Illegitimate implicitly-unsigned-literal warning for LLONG_MIN value."
href="https://bugs.llvm.org/show_bug.cgi?id=33537">33537</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Illegitimate implicitly-unsigned-literal warning for LLONG_MIN value.
</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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>babokin@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>clang trunk, x86_64.
Using long long literal with LLONG_MIN value causes illegitimate warning. Note
using LLONG_MIN macro is ok, as it's defined as (-9223372036854775807LL -1)
<span class="quote">> cat f.cpp</span >
#include <climits>
// these guys are ok.
int min_int1 = -2147483648;
int min_int2 = INT_MIN;
// min_ll1 causes troubles, while min_ll2 is ok, because it's defined as
(-9223372036854775807LL -1)
long long int min_ll1 = -9223372036854775808LL; // 0x8000000000000000LL
long long int min_ll2 = LLONG_MIN;
<span class="quote">> clang++ f.cpp -c</span >
f.cpp:6:26: warning: integer literal is too large to be represented in a signed
integer type, interpreting as unsigned [-Wimplicitly-unsigned-literal]
long long int min_ll1 = -9223372036854775808LL; // 0x8000000000000000LL
^
1 warning generated.</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>