[LLVMbugs] [Bug 21794] New: Tautological constant deduction is incorrect

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Dec 9 12:53:25 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=21794

            Bug ID: 21794
           Summary: Tautological constant deduction is incorrect
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: pavol at klacansky.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

This simple program causes false warning during compilation.

#include <stdint.h>
#include <stdio.h>


int
main(void)
{
    uint16_t a = 13;
    printf("%d\n", a != ~0);
    return 0;
}


test.c:9:22: warning: comparison of constant -1 with expression of type
'uint16_t'
      (aka 'unsigned short') is always true
      [-Wtautological-constant-out-of-range-compare]
    printf("%d\n", a != ~0);

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141209/df981466/attachment.html>


More information about the llvm-bugs mailing list