[tz] source code question regarding localtime.c PS

Alan Barrett apb at cequrux.com
Wed Aug 7 17:36:16 UTC 2013


On Wed, 07 Aug 2013, Arthur David Olson wrote:
> > Of course, there's no requirement that time_t values map to times in a
> > linear manner...
>
>From...
>    http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/types.h.html
>...we have:
>    time_t: Used for time in seconds.

Yes, POSIX requires that time_t is encoded in seconds, but ISO 
C does not.  ISO 8988:1999 section 7.23.2.4 says, of the time_t 
value returned by the the time() function, "The encoding of the 
value is unspecified."

Perhaps there should be some clear documentation of the 
portability goals of the tz code project.  As far as I am aware, 
the tz project assumes that time_t is encoded in seconds, and 
assumes that time_t is either an integer or floating point type.

--apb (Alan Barrett)


More information about the tz mailing list