This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: mktime()
On Aug 17 09:29, Howland Craig D (Craig) wrote:
> Steve:
> I agree that the month test should include a <0 check to be
> consistent with the other tests.
> tm_isdst should indeed be set to 0 when there is no DST and it is
> passed as -1. (The code produces the correct time result in this case,
> failing only to change tm_isdst appropriately.)
> I have attached a patch which addresses both of these problems.
> This also raises an interesting question about what to do with no
> DST (e.g. with GMT) but the user passes tm_isdst>=1. It could be
> considered to be illegal input. Neither the C standard nor POSIX
> comment
> on this case. The patch as it is chooses to ignore the given tm_isdst
> when the current timezone has no DST.
That sounds like the right thing to do. In thoery, the daylight saving
time of the given timezone is just 0.
> Craig
>
> 2011-08-17 Craig Howland <howland@LGSInnovations.com>
>
> * libc/time/mktime.c: set tm_isdst=0 when !daylight; account
> for
> tm_mon possibly being given as negative.
The patch looks good to me. Please apply.
Thanks,
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat