On 03/02/2016 09:38 PM, Random832 wrote:
Are you saying that the_actual intent_ of the POSIX committee was to forbid the use of the traditional System III timezone format, rather than allowing it (as the brackets imply) and having the rules be implementation-defined?
That's what I was saying, yes, but it appears I was incorrect. The original intent was to allow the syntax TZ='PST8PDT', but to leave the daylight-saving rules unspecified in this case. Hence the test case that prompted this thread (though most likely illustrating a bug in glibc) does not illustrate a violation of POSIX, because portable programs should not assume that TZ strings like 'PST8PDT' have any particular behavior with respect to when DST starts and stops. This is all stated clearly in the rationale for POSIX 1003.1-1988. I guess that part of the rationale has been discareded in more recent editions of the standard, which makes the current standard confusing (it confused *me*, anyway). Quoting from B8.1.1, page 267: "Rules of the form AAAn or AAAnBBB (the style used in many historical implementations) do not carry with them any statement about the start and end of daylight time.... An implementation may provide those rules in any way it sees fit, as long as the constraints implied by the TZ string as provided by the user are met. Specifically the implementation may use the string as an index into a table, which may reside either on disk or in memory. Such tables could contain rules which are sensitive to the year to which they are supplied, again since the user did not specify the exact rule.... "There is at least one public domain time zone implementation (the Olson/Harris method) that uses non-specific TZ strings and a table, as described above and handles all the general time zone problems mentioned above.... Nothing precludes the implementation from adding information beyond that given by the user in the TZ string." To try to save Guy Harris some time in reply, I should mention that there is an attribution error in rationale quoted above. As Guy wrote on 1991-09-25 in comp.unix.misc, "It is referred to as the 'Olson/Harris' method by the rationale for section B.8.1.1 in the POSIX 1003.1 spec, but as the 'Harris' in question, I'd prefer it just be called the 'Arthur Olson' method; it was Arthur's idea, and while I was *one* of the contributors to the implementation, other contributors provided at least as much stuff as I did." <https://groups.google.com/forum/?_escaped_fragment_=msg/comp.unix.misc/-ipgF...>.