[PATCH] Change time_t to 64-bit by default

Corinna Vinschen vinschen@redhat.com
Fri Sep 8 14:46:00 GMT 2017

On Sep  8 07:40, Freddie Chopin wrote:
> On Thu, 2017-09-07 at 15:58 -0600, Brian Inglis wrote:
> > The question is, going forward, should we use long for bigger than
> > int values as
> > usual, or use time_t instead, to consistently avoid long, in these
> > time functions.
> I think we should go with time_t, which will be 32-bit or 64-bit long,
> depending on what was chosen during newlib compilation.

While that's nice and all, two points to keep in mind:

* 64 bit computations are costly on 32 bit (or even 16 bit) platforms
  and should be avoided if overkill isn't your goal.

* days, months, years, etc, are *all* of type int in struct tm,
  per POSIX.  Adding 64 bit ops just to fold stuff back into ints
  might only make marginal sense.


Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20170908/d6bc4799/attachment.sig>

More information about the Newlib mailing list