Bug 15524 - [DR#437] clock() behaves incorrectly on overflow
Summary: [DR#437] clock() behaves incorrectly on overflow
Status: SUSPENDED
Alias: None
Product: glibc
Classification: Unclassified
Component: time (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-23 20:24 UTC by Rich Felker
Modified: 2015-08-27 22:15 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rich Felker 2013-05-23 20:24:04 UTC
According to the Austin Group interpretation for issue 686 (http://austingroupbugs.net/view.php?id=686), the current behavior of clock() on 32-bit systems, wrapping when it overflows the range of clock_t, is non-conforming to the requirements of ISO C, which require returning (clock_t)-1 if the result is not representable.
Comment 1 Joseph Myers 2015-08-24 11:38:17 UTC
C11 DR#437 is still open, but the currently proposed TC says the return value should be unspecified on overflow, so allowing existing widespread implementation practice.

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1931.htm#dr_437