Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c    |    Meh, in C you gotta define EVERYTHING    |    243,242 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 242,805 of 243,242    |
|    David Brown to James Kuyper    |
|    Re: printf and time_t    |
|    05 Jan 26 20:38:14    |
      From: david.brown@hesbynett.no              On 05/01/2026 20:00, James Kuyper wrote:       > On 2026-01-05 13:28, David Brown wrote:       >> On 05/01/2026 19:11, James Kuyper wrote:       >>> On 2026-01-05 11:34, David Brown wrote:       >>> ...       >>>> As I understand it, time_t is intended to be suitable for holding a       >>>> number of seconds ...       >>>       >>> The standard says nothing about that.       >>>       >>>> ... (it is used for that purpose in struct timespec). ...       >>>       >>> The standard says nothing to connect time_t to struct timespec.       >>       >> 7.27.1p4:       >>       >> The range and precision of times representable in clock_t and time_t are       >> implementation-defined. The timespec structure shall contain at least       >> the following members, in any order. The semantics of the members and       >> their normal ranges are expressed in the comments.       >>       >> time_t tv_sec; // whole seconds -- >= 0       >> long tv_nsec; // nanoseconds -- [0, 999999999]       >       > I'm not sure how I missed that in my search.              Probably in the same way I regularly miss details...              > In the latest draft of the       > standard I could find, n3685.pdf, that's in 7.21.1p6. I found struct       > timespec mentioned in 7.21.1p5 with no detailed specification, and       > didn't bother reading the next paragraph, which provides that       > specification. If I had thought about it, I would have realized that the       > same was true of struct tm, which I know from long experience has a       > detailed specification.              There is still nothing, as far as I can see, that guarantees other       functions returning time_t work in seconds.              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca