Given the recent note about 32-bit long vs 64-bit time_t on x32: zdump(8), run on gentoo x32, gives the same output as when run on amd64, with zdump -v America/New_York ending with: ,----< zdump -v America/New_York | tail -n 6 > | America/New_York Sun Mar 8 06:59:59 2499 UTC = Sun Mar 8 01:59:59 2499 EST isdst=0 | America/New_York Sun Mar 8 07:00:00 2499 UTC = Sun Mar 8 03:00:00 2499 EDT isdst=1 | America/New_York Sun Nov 1 05:59:59 2499 UTC = Sun Nov 1 01:59:59 2499 EDT isdst=1 | America/New_York Sun Nov 1 06:00:00 2499 UTC = Sun Nov 1 01:00:00 2499 EST isdst=0 | America/New_York 9223372036854689407 = NULL | America/New_York 9223372036854775807 = NULL `---- The Gentoo ebuild has a patch(5) for Makefile to install things where they prefer, but makes no changes to the code. So, based on that one datapoint ☺, 32-bit long and 64-bit time_t should work out of the box. -JimC -- James Cloos <cloos@jhcloos.com> OpenPGP: 1024D/ED7DAEA6
On 05/30/13 06:16, James Cloos wrote:
So, based on that one datapoint ☺, 32-bit long and 64-bit time_t should work out of the box.
The zdump bugs fixed in the latest proposed patch are fairly esoteric, and shouldn't be triggered merely by running 'zdump -v America/New_York'. An example of such a bug might be something more like this: zdump -v -c 2147483647,2147483648 America/New_York where that 2147483648 will overflow the old zdump on a machine with 32-bit long and 64-bit time_t even though the cutoff time is representable both as a time_t and as a struct tm. This latter invocation of zdump runs afoul of at least one other bug in the reference implementation, which I haven't had time to track down; but one bug at a time. I should mention one other thing: it's possible that a machine with 64-bit time_t and 32-bit long will work just fine with the unpatched zdump etc., even though it mistakenly tries to stuff a 64-bit quantity into a 32-bit variable. This is because in C, signed overflow has undefined behavior, and some implementations store signed 32-bit quantities in 64-bit registers, as they are allowed to do -- which means that a 32-bit 'long' value can actually store values up to 2**63, if you're lucky.
"PE" == Paul Eggert <eggert@cs.ucla.edu> writes:
PE> The zdump bugs fixed in the latest proposed patch are fairly PE> esoteric, and shouldn't be triggered merely by running PE> 'zdump -v America/New_York'. An example of such a bug PE> might be something more like this: PE> zdump -v -c 2147483647,2147483648 America/New_York OK. I must have only skimmed the earlier messages, and missed that it was an issue with argument processing rather than with parsing tzfile(5)s. -JimC -- James Cloos <cloos@jhcloos.com> OpenPGP: 1024D/ED7DAEA6
participants (2)
-
James Cloos -
Paul Eggert