Aug. 14, 2020
10:48 p.m.
On 8/13/20 10:52 PM, Robert Elz wrote:
I suppose that might be technically allowed
Yes, it's allowed.
if (tm_sec == INT_MAX) { tm_sec--; if (mktime() != (time_t)-2) /* error case */; else /* was Dec 31, 1969, UTC */; } else { tm_sec++; if (mktime() != (time_t)0) /* error case */; else /* was Dec 31, 1969 */; }
If this is the sort of thing portable code needs to do in order to determine whether mktime has succeeded, then mktime's API needs improving.