https://bugs.llvm.org/show_bug.cgi?id=33537

            Bug ID: 33537
           Summary: Illegitimate implicitly-unsigned-literal warning for
                    LLONG_MIN value.
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangb...@nondot.org
          Reporter: babo...@gmail.com
                CC: llvm-bugs@lists.llvm.org

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)

> cat f.cpp
#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;
> clang++ f.cpp -c
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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to