This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/13080] New: clock() is unusable on 32-bit targets due to wrong type for clock_t
- From: "bugdal at aerifal dot cx" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Thu, 11 Aug 2011 20:36:26 +0000
- Subject: [Bug libc/13080] New: clock() is unusable on 32-bit targets due to wrong type for clock_t
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=13080
Bug #: 13080
Summary: clock() is unusable on 32-bit targets due to wrong
type for clock_t
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: drepper.fsp@gmail.com
ReportedBy: bugdal@aerifal.cx
Classification: Unclassified
glibc defines clock_t as signed long rather than unsigned long. On 32-bit
targets where the value can wrap, this makes it impossible to subtract clock_t
values to measure intervals (signed overflow results in undefined behavior).
This issue is easily fixed by changing the definition of clock_t on 32-bit
targets to unsigned long, and doing so should not result in any API or ABI
breakage.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.