This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/13080] 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: Tue, 30 Aug 2011 18:07:34 +0000
- Subject: [Bug libc/13080] clock() is unusable on 32-bit targets due to wrong type for clock_t
- Auto-submitted: auto-generated
- References: <bug-13080-131@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=13080
--- Comment #2 from Rich Felker <bugdal at aerifal dot cx> 2011-08-30 18:07:34 UTC ---
I haven't worked out an example yet, but I suspect you can construct a case
where gcc will optimize out a necessary comparison due to the fact that signed
arithmetic cannot overflow. I agree it's unfortunate that fixing this bug
would break C++ functions using clock_t arguments, but this is a genuine bug
and it will probably eventually have visible effects (possibly deadlock or
random hour-long sleeps) as optimizers get more and more aggressive. And of
course, code using clock_t will *always* break when compiling with trapping
overflow mode.
--
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.