On 2025-09-24 10:14, Robert Elz wrote:
     Date:        Wed, 24 Sep 2025 07:39:27 -0700
     From:        Paul Eggert <[email protected]>
   | This wording is
   | intended to require the 7th Edition Unix behavior, where calling any of
   | localtime, gmtime, and ctime overwrote the same struct tm object.

No it isn't, it is meant to allow that behaviour - no-one with even an
iota of sanity would require things to be implemented that way.

If only you could go back to the 1980s and whisper that into Douglas Gwyn's ears! Alas, the C89 standardizers wrote C89 they way they wrote it, and unfortunately they intended for things to be done the 7th edition Unix way, as that was the existing practice. As I mentioned this is not just my opinion; it's the opinion of the glibc developers who read the spec back in the early 1990s and who implemented localtime/gmtime in the obvious way required by C89. And it's not just glibc developers; a similar statement about what C89 requires can be found in NI' documentation for LabWindows/CI <https://www.ni.com/docs/en-US/bundle/labwindows-cvi/page/cvi/libref/cvigmtime.htm>

I don't know of any contemporaneous expert who disagreed with this interpretation. With hindsight we perhaps might say they were crazy, but they did not have the benefit of our hindsight.

Reply via email to