diff --git a/NEWS b/NEWS index c1e8ba3..355aea6 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,16 @@ Unreleased, experimental changes Palestine will fall back at 00:00, not 01:00. (Thanks to Steffen Thorsen.) + Changes affecting API + + The types of the global variables 'timezone' and 'altzone' (if present) + have been changed back to 'long'. This is required for 'timezone' + by POSIX, and for 'altzone' by common practice, e.g., Solaris 11. + These variables were originally 'long' in the tz code, but were + mistakenly changed to 'time_t' in 1987; nobody reported the + incompatibility until now. The difference matters on x32, where + 'long' is 32 bits and 'time_t' is 64. (Thanks to Elliott Hughes.) + Changes affecting the build procedure Avoid long strings in leapseconds.awk to work around a mawk bug. diff --git a/localtime.c b/localtime.c index f2004b5..8c8edf3 100644 --- a/localtime.c +++ b/localtime.c @@ -215,12 +215,12 @@ char * tzname[2] = { static struct tm tm; #ifdef USG_COMPAT -time_t timezone = 0; +long timezone = 0; int daylight = 0; #endif /* defined USG_COMPAT */ #ifdef ALTZONE -time_t altzone = 0; +long altzone = 0; #endif /* defined ALTZONE */ static int_fast32_t diff --git a/strftime.c b/strftime.c index aba3d33..c324f1b 100644 --- a/strftime.c +++ b/strftime.c @@ -492,7 +492,7 @@ label: continue; case 'z': { - int diff; + long diff; char const * sign; if (t->tm_isdst < 0)