[tz] [PROPOSED 2/2] strftime: conform better to POSIX+

Paul Eggert eggert at cs.ucla.edu
Fri Aug 14 22:48:28 UTC 2020


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.



More information about the tz mailing list