[LLVMbugs] [Bug 23204] New: -Wabsolute-value gives false positives

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Apr 11 10:16:35 PDT 2015


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

            Bug ID: 23204
           Summary: -Wabsolute-value gives false positives
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mayer.julian at googlemail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

version is Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn)


the new absolute value warning in xcode 4.3 seems bugged

it gives a warning on this code:

    printf("\n\n\n%li\n\n",
           labs([@"12345" length] - [@"1234567" length]));


which outputs "2". it says the labs() is not necessary.

however, when removing it the output is -2. so the warning clearly directs
users into making wrong code changes...

-- 
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/20150411/45684bb1/attachment.html>


More information about the llvm-bugs mailing list