Re: [PATCH] Use time_t for timestamps returned by approxidate() instead of unsigned
- From
Tim Henigan <tim.henigan@gmail.com>
- Date
- Jan 24, 2009, 16:13 UTC
- Message-ID
- <32c343770901240813k2eeb19b0q65b533f829cb44d4@mail.gmail.com>
- In-Reply-To
- <alpine.DEB.1.00.0901240726070.13232@racer>
On Sat, Jan 24, 2009 at 1:27 AM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
Show 11 quoted lines
> > Hi, > > On Thu, 22 Jan 2009, Tim Henigan wrote: > > > Use time_t for timestamps returned by approxidate() instead of unsigned > > long. All references to approxidate were checked as well as references > > to OPT_DATE. > > Hmm. I vaguely remember Linus mentioning recently that unsigned long is > the appropriate data type for the Unix Epoch...
You are correct. I just found a post on this list where Linus specifically rejected a similar patch from another contributor. A quote from https://kerneltrap.org/mailarchive/git/2008/11/6/4014124:
" "time_t" is one of those totally broken unix types. The
standards say that
it's an "arithmetic" type, but leaves it open to be just about anything.
Traditionally, it's a signed integer (bad), and in theory it could even be
a floating point value, I think. And in _all_ such cases, it's actually better to cast it to "unsigned
long" than keep time in a system-dependent format that is most likely
either _already_ "unsigned long", or alternatively broken."Should I update the GitWiki page to remove this Janitor task or do you keep it as a test to see if people are properly searching the mail archives?
Sorry to waste your time on the patch review.
Thanks, Tim