This is the mail archive of the 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 math/865] New: <tgmath.h> bug for binary and ternary functions with int and float

The definitions in <tgmath.h> of __TGMATH_BINARY_REAL_ONLY, 
__TGMATH_BINARY_REAL_IMAG are buggy when the function has arguments of 
type float and an integer type.  If any argument is of integer type then 
the function chosen should be that for double or long double according to 
whether any other argument has type long double, not that for float even 
if all other arguments have type float, and the type of the result should 
be determined accordingly.  For example,

  int x;
  float y;
  sizeof(pow(x, y)); // Should have value sizeof(double), but doesn't with
                     // current glibc.

I believe __typeof((__tgmath_real_type(Val1))0 + 
(__tgmath_real_type(Val2))0) should be used in place of __tgmath_real_type 
((Val1) + (Val2)), and similarly for ternary functions.

           Summary: <tgmath.h> bug for binary and ternary functions with int
                    and float
           Product: glibc
           Version: 2.3.5
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: aj at suse dot de
        ReportedBy: jsm28 at gcc dot gnu dot org
                CC: glibc-bugs at sources dot redhat dot com

------- 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]