This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug libc/535] difftime double-rounding bug if 64-bit time_t and long double=double
- From: "cvs-commit at gcc dot gnu dot org" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 11 Nov 2004 22:31:05 -0000
- Subject: [Bug libc/535] difftime double-rounding bug if 64-bit time_t and long double=double
- References: <20041110064105.535.eggert@gnu.org>
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-11-11 22:31 -------
Subject: Bug 535
CVSROOT: /cvs/glibc
Module name: libc
Changes by: roland@sources.redhat.com 2004-11-11 22:30:57
Modified files:
time : difftime.c
Log message:
2004-11-09 Paul Eggert <eggert@cs.ucla.edu.
[BZ #535]
* time/difftime.c: Fix a double-rounding bug on hosts with
64-bit time_t and long double being IEEE double. Also, port
to more valid C99 hosts, even those that have padding bits.
Don't include <values.h> since it is marked as an obsolescent
interface. Include <limits.h>, <float.h>, and <stdint.h> instead.
(TYPE_BITS, TYPE_FLOATING, TYPE_SIGNED): New macros.
(subtract): New static function, that works correctly without
double-rounding, even on hosts with 64-bit time_t. Also cater
to hosts with padding bits.
(__difftime): Use it. Use DBL_MANT_DIG and LDBL_MANT_DIG to
determine whether floating types are wide enough: the old
test (which used sizeof) could in theory report the wrong results
on hosts with padding bits in floating-point values.
Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/time/difftime.c.diff?cvsroot=glibc&r1=1.7&r2=1.8
--
http://sources.redhat.com/bugzilla/show_bug.cgi?id=535
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.