Second part of localtime.c changes
Olson, Arthur David (NIH/NCI <olsona <at> dc37a.nci.nih.gov>
2005-01-01 18:27:36 GMT
Having dispensed with the easy stuff last week, below find the hard stuff.
The goal is to better behavior of localtime and gmtime on systems where
time_t is an exotic type--for example, a 64-bit integer or a double.
A problem is that the tm_year field of a "struct tm" field is, by standard,
an int--so there are some (very positive or very negative) time_t values
that can't be broken down into a "struct tm".
I've adopted existing practice here--localtime and gmtime return NULL in
such cases.
The system I'm using is a Sunblade 100 running gcc version 3.2.3. If I do a
"make typecheck" using version 7.85 of localtime.c and then do a "make
typecheck" using version 7.86, I get these differences:
29,30c29,30
< US/Eastern Sat Oct 16 08:29:52 -1583348 UTC = Sat Oct 16 03:29:52
-1583348 EST isdst=0
< US/Eastern Sun Oct 17 08:29:52 -1583348 UTC = Sun Oct 17 03:29:52
-1583348 EST isdst=0
---
> US/Eastern -9223372036854775808 = NULL
> US/Eastern -9223372036854689408 = NULL
501,502c501,502
< US/Eastern Sun Mar 16 15:30:07 1587287 UTC = Sun Mar 16 10:30:07
1587287 EST isdst=0
< US/Eastern Mon Mar 17 15:30:07 1587287 UTC = Mon Mar 17 10:30:07
1587287 EST isdst=0
---
> US/Eastern 9223372036854689407 = NULL
> US/Eastern 9223372036854775807 = NULL
524,525c524,525
(Continue reading)