[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Bug-gnulib] getdate.y question

From: Conrad T. Pino
Subject: RE: [Bug-gnulib] getdate.y question
Date: Wed, 12 May 2004 11:17:48 -0700

Hi Derek,

I saw Paul Eggert is already working on a resolution.

> From: Derek Robert Price
> >Where should I look to find out what the issue is?
>     http://mail.gnu.org/archive/html/bug-cvs/2004-04/msg00333.html
> Basically, getdate() used to reject invalid dates & times like, "Jan.
> 40th, 2004".  To fix a bug & reuse code, the GNULIB team decided to
> have getdate.y use the mktime() function to convert a broken down time
> structure back into a time_t/seconds since the epoch.  Unfortunately,
> mktime converts overflow in certain fields to valid dates and maybe
> times, in the case of this example, it will yield Feb. 9th.
> I'm not sure whether the correct fix would be some sort of overflow
> checking in getdate.y (though I worry that this solution would end up
> duplicating much of the same code from mktime() that we wish to avoid
> duplicating), or the implementation of some sort of "overflow
> converted" return value from mktime(), or perhaps even a new argument
> to mktime() to force strict overflow checks (more likely a new
> mktime_strict() function which could wrap and share an internal
> function with mktime(), to prevent changing the mktime() interface),

Well stated and very helpful.  It's a library code policy issue rather
than solely technical.

> Cheers,

Thank you,

> Derek


reply via email to

[Prev in Thread] Current Thread [Next in Thread]