public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug manual/31808] New: The supported time_t range is not documented.
@ 2024-05-27 22:57 vincent-srcware at vinc17 dot net
  2024-05-28  0:06 ` [Bug manual/31808] " gabravier at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: vincent-srcware at vinc17 dot net @ 2024-05-27 22:57 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31808

            Bug ID: 31808
           Summary: The supported time_t range is not documented.
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: manual
          Assignee: unassigned at sourceware dot org
          Reporter: vincent-srcware at vinc17 dot net
                CC: mtk.manpages at gmail dot com
  Target Milestone: ---

The ISO C17 standard says about time_t:

  The range and precision of times representable in clock_t and time_t
  are implementation-defined.

The glibc manual says that time_t is an integer, but nothing about the actual
supported range (for positive and negative values):

 -- Data Type: time_t

     ‘time_t’ is the simplest data type used to represent simple
     calendar time.

     In ISO C, ‘time_t’ can be either an integer or a floating-point
     type, and the meaning of ‘time_t’ values is not specified.  The
     only things a strictly conforming program can do with ‘time_t’
     values are: pass them to ‘difftime’ to get the elapsed time between
     two simple calendar times (*note Calculating Elapsed Time::), and
     pass them to the functions that convert them to broken-down time
     (*note Broken-down Time::).

     On POSIX-conformant systems, ‘time_t’ is an integer type and its
     values represent the number of seconds elapsed since the “epoch”,
     which is 00:00:00 on January 1, 1970, Coordinated Universal Time.

     The GNU C Library additionally guarantees that ‘time_t’ is a signed
     type, and that all of its functions operate correctly on negative
     ‘time_t’ values, which are interpreted as times before the epoch.

This is important, because if values > 2^52 are officially supported in
magnitude, the difftime() function would have to round the result, and the
exact behavior is not documented in such a case, e.g. which rounding mode is
used and whether an "inexact" exception may be signaled (with the consequence
that difftime() may not be a pure function, due to a side effect).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug manual/31808] The supported time_t range is not documented.
  2024-05-27 22:57 [Bug manual/31808] New: The supported time_t range is not documented vincent-srcware at vinc17 dot net
@ 2024-05-28  0:06 ` gabravier at gmail dot com
  2024-05-28  2:23 ` eggert at cs dot ucla.edu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: gabravier at gmail dot com @ 2024-05-28  0:06 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31808

Gabriel Ravier <gabravier at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gabravier at gmail dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug manual/31808] The supported time_t range is not documented.
  2024-05-27 22:57 [Bug manual/31808] New: The supported time_t range is not documented vincent-srcware at vinc17 dot net
  2024-05-28  0:06 ` [Bug manual/31808] " gabravier at gmail dot com
@ 2024-05-28  2:23 ` eggert at cs dot ucla.edu
  2024-05-28 17:20 ` eggert at cs dot ucla.edu
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: eggert at cs dot ucla.edu @ 2024-05-28  2:23 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31808

eggert at cs dot ucla.edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |eggert at cs dot ucla.edu

--- Comment #1 from eggert at cs dot ucla.edu ---
Created attachment 15539
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15539&action=edit
Remove incorrect attrs from difftime decls

Thanks for reporting the problem. This is a bug in the code, not just the
documentation. Proposed code patch attached.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug manual/31808] The supported time_t range is not documented.
  2024-05-27 22:57 [Bug manual/31808] New: The supported time_t range is not documented vincent-srcware at vinc17 dot net
  2024-05-28  0:06 ` [Bug manual/31808] " gabravier at gmail dot com
  2024-05-28  2:23 ` eggert at cs dot ucla.edu
@ 2024-05-28 17:20 ` eggert at cs dot ucla.edu
  2024-05-28 17:21 ` [Bug time/31808] " eggert at cs dot ucla.edu
  2024-06-04 16:08 ` eggert at cs dot ucla.edu
  4 siblings, 0 replies; 6+ messages in thread
From: eggert at cs dot ucla.edu @ 2024-05-28 17:20 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31808

eggert at cs dot ucla.edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
           Assignee|unassigned at sourceware dot org   |eggert at cs dot ucla.edu
   Last reconfirmed|                            |2024-05-28
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #2 from eggert at cs dot ucla.edu ---
Created attachment 15542
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15542&action=edit
Improve doc for time_t range

... and here is a patch to the documentation

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug time/31808] The supported time_t range is not documented.
  2024-05-27 22:57 [Bug manual/31808] New: The supported time_t range is not documented vincent-srcware at vinc17 dot net
                   ` (2 preceding siblings ...)
  2024-05-28 17:20 ` eggert at cs dot ucla.edu
@ 2024-05-28 17:21 ` eggert at cs dot ucla.edu
  2024-06-04 16:08 ` eggert at cs dot ucla.edu
  4 siblings, 0 replies; 6+ messages in thread
From: eggert at cs dot ucla.edu @ 2024-05-28 17:21 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31808

eggert at cs dot ucla.edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |2.40
          Component|manual                      |time

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug time/31808] The supported time_t range is not documented.
  2024-05-27 22:57 [Bug manual/31808] New: The supported time_t range is not documented vincent-srcware at vinc17 dot net
                   ` (3 preceding siblings ...)
  2024-05-28 17:21 ` [Bug time/31808] " eggert at cs dot ucla.edu
@ 2024-06-04 16:08 ` eggert at cs dot ucla.edu
  4 siblings, 0 replies; 6+ messages in thread
From: eggert at cs dot ucla.edu @ 2024-06-04 16:08 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31808

eggert at cs dot ucla.edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #3 from eggert at cs dot ucla.edu ---
Documentation problem fixed in commit 400bdb5c85af5a52b3f5653357c9fca87f036bd3
dated Tue May 28 10:07:47 2024 -0700 titled "Improve doc for time_t range (BZ
31808)". Code problem fixed in commit cafef3eb21db24f2e8113b0adc12c0f15d4dec41
dated Tue May 28 10:07:47 2024 -0700 titled "difftime can throw exceptions".

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-06-04 16:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-27 22:57 [Bug manual/31808] New: The supported time_t range is not documented vincent-srcware at vinc17 dot net
2024-05-28  0:06 ` [Bug manual/31808] " gabravier at gmail dot com
2024-05-28  2:23 ` eggert at cs dot ucla.edu
2024-05-28 17:20 ` eggert at cs dot ucla.edu
2024-05-28 17:21 ` [Bug time/31808] " eggert at cs dot ucla.edu
2024-06-04 16:08 ` eggert at cs dot ucla.edu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).