This is the mail archive of the glibc-bugs@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/200] New: missing parens in define


In stdlib/gmp-impl.h, there is a #define of the form:
#define ABS(x) (x >= 0 ? x : -x)

It should be

#define ABS(x) ((x) >= 0 ? (x) : -(x))

Otherwise, ABS(n+1) will given an incorrect answer for most negative numbers.

-- 
           Summary: missing parens in define
           Product: glibc
           Version: 2.3.2
            Status: NEW
          Severity: minor
          Priority: P2
         Component: libc
        AssignedTo: gotom at debian dot or dot jp
        ReportedBy: miles at cray dot com
                CC: glibc-bugs at sources dot redhat dot com


http://sources.redhat.com/bugzilla/show_bug.cgi?id=200

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]