Alexander Belopolsky wrote:
I think the best way forward would be to document the fact that a tzfile with the last explicit transition not matching a POSIX rule transition is invalid and the behavior of localtime with such file is undefined.
Thanks for thinking it through. I implemented that in the attached patches, which also change zic.c to obey the new restriction on tzfile format. I installed these patches into the experimental repository on GitHub.
I suggest fixing the issue in two steps:
1. Add 2038-03-28 transition to the Morocco rules in the raw africa file.
I don't see how that would work for 32-bit data, since 2038-03-28 is outside the 32-bit window. Another possibility would be to remove Morocco's 2037 transitions to cater to now-buggy zic implementations like zic 2016f, but I'm not sure it's worth the hassle.
2. Modify zic to warn about raw files where the last explicit transition does not match the rule from the POSIX string and add an appropriate transition in the binary file.
The attached patch merely adds the appropriate transition without warning. If someone wants to change zic.c to emit such a warning, that'd be OK too.