E
Eric Sosman
Eric Sosman said:[...]
I remember seeing the [0..61] range for tm_sec long ago, and
perhaps it still persists in some non-C documents. Even in the
original 1989 ANSI C Standard, though, the range was [0..60] in
keeping with the fact that leap seconds are added (or removed)
one at a time, never two at once.
The 1990 ISO C standard specifies a range of [0, 61] for tm_sec:
int tm_sec; /* seconds after the minute -- [0, 61] */
with a footnote:
The range [0,61] for tm_sec allows for as many as two leap seconds.
C99 changes the range to [0, 60] and changes the footnote to:
The range [0, 60] for tm_sec allows for a positive leap second.
There's no mention of the change in the C99 rationale.
[...]
Are you *sure* that the 1989 ANSI standard specifies [0, 60]?
If so, that would be an inconsistency between ANSI C89 and ISO C90,
and I didn't think there were any.
Interestingly, a 1988 ANSI C draft ("ansi.c.txt", I'm not sure
where I got it) shows a range of [0, 60].
That's what I consulted; I don't have the actual C90 document.
The footnote reads "The range [0, 60] for tm_sec allows for the
occasional leap second." Perhaps the range shown in the draft
was, er, corrected in the eventual Standard.