[LLVMbugs] [Bug 14850] New: Add static analyzer suggesting std::copysign in place of a/fabs(a)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jan 8 08:40:43 PST 2013


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

             Bug #: 14850
           Summary: Add static analyzer suggesting std::copysign in place
                    of a/fabs(a)
           Product: clang
           Version: 3.2
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: giulio.eulisse at cern.ch
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


In gcc one could enable the option -mrecip=div which has the side effect that 

a/fabs(a)

is no longer in {+1.0, -1.0, NaN}, this leads to instabilities in case the code
uses such a construct as poor man std::copysign. It would be desiderable to
have a static analyzer which can detect those constructs and warn to use
copysign instead.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list