[llvm-bugs] [Bug 41054] New: misc-incorrect-roundings does not catch incorrect rounding within the Conditional Operator
    via llvm-bugs 
    llvm-bugs at lists.llvm.org
       
    Wed Mar 13 08:59:19 PDT 2019
    
    
  
https://bugs.llvm.org/show_bug.cgi?id=41054
            Bug ID: 41054
           Summary: misc-incorrect-roundings does not catch incorrect
                    rounding within the Conditional Operator
           Product: clang
           Version: 6.0
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: dcoughlin at apple.com
          Reporter: lennart.cormin at ericsson.com
                CC: dcoughlin at apple.com, llvm-bugs at lists.llvm.org
I run the checker misc-incorrect-roundings on this piece of code:
return (int) (x < 0 ? x - 0.5 : x + 0.5);
In this case Clang tidy does not pick up on the “x + 0.5” as being an incorrect
rounding, which it is.
-- 
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/20190313/20dae456/attachment.html>
    
    
More information about the llvm-bugs
mailing list