This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug math/865] New: <tgmath.h> bug for binary and ternary functions with int and float
- From: "jsm28 at gcc dot gnu dot org" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 22 Apr 2005 16:05:55 -0000
- Subject: [Bug math/865] New: <tgmath.h> bug for binary and ternary functions with int and float
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
The definitions in <tgmath.h> of __TGMATH_BINARY_REAL_ONLY,
__TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY, __TGMATH_TERNARY_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
http://sources.redhat.com/bugzilla/show_bug.cgi?id=865
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.