This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Introduction and 64 bit time_t
- From: <philipp dot trommler at preh dot de>
- To: <newlib at sourceware dot org>
- Date: Fri, 11 Aug 2017 13:20:31 +0200
- Subject: Re: Introduction and 64 bit time_t
- Authentication-results: sourceware.org; auth=none
- References: <20170809192410.GI3195@calimero.vinschen.de>
Hi again,
first of all, thanks to Sebastion for his example of how to add
something like that to newlib. It really helped me getting my feet wet.
In the reply to this mail is the patch I came up with in order to
define time_t to an appropriate type. I'm happy for any feedback on it.
However, during the tests I did, I recognized that though sizeof(time_t)
has been 8 now, our software did a wrap-around in January 2038. I was
able to track it down to gmtime_r where the time_t lcltime gets casted
to long in order to fit into days and rem.
Having days and rem be a time_t and removing the casts fixes the wrap-
around for me, but I highly suspect that this is not a *clean* way to do
it. What are your sugestions on this? Which type should days and rem
have?
Regards
Philipp