Email List: Xaustin-review-lX
[All Lists]

Re: Defect in XSHd7 strftime()

To: yyyyyy@xxxxxxxxxxxxxxx
Subject: Re: Defect in XSHd7 strftime()
From: "H. Peter Anvin" <yyy@xxxxxxxxx>
Date: Tue, 15 Jan 2002 18:32:27 -0800
Cc: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
References: <200201160202.CAA18561@xxxxxx>
yyyyyy@xxxxxxxxxxxxxxx wrote:


1. The specification is unclear on what happens to existing
local-time-related data, when the environment variable 'TZ' is
changed. 

In particular, the indended result is unclear in the following
situation:
* mktime(), localtime(), or localtime_r() create or modify a
'struct tm' value.
* The 'TZ' environment variable is altered.
* strftime() is called with the %Z or %z conversion specifiers,
with the old 'struct tm' as an argument.
Some Unix platforms store time zone information in private fields
within a 'struct tm', and thus output the old time zone. Some use
a global variable, and thus output the new time zone. Some platforms
store a pointer to a current time zone object, and thus may output
invalid data.


I believe mktime() cannot be made to operate correctly unless such information exists in private fields.

I believe we really should standardize these fields, thus making them availavle to all applications. Unfortunately, that's hardly in scope for a defect report.

-hpa

<Prev in Thread] Current Thread [Next in Thread>