[tz] suggestions for potential code improvements?

Paul Eggert eggert at cs.ucla.edu
Thu Jul 30 20:49:14 UTC 2015

Kees Dekker wrote:
> Localtime.c will have a gmtime_r() but of the system does not recognize gmtime_r(), there is also no prototype.

We can fix that in localtime.c by defining gmtime_r before using it, as in the 
attached proposed patch.

> So both localtime.c and zdump.c will suffer from it.

I don't see why zdump.c suffers from any problem here.  When zdump.c defines its 
own gmtime_r, it does so before using it.

> And I would expect only one implementation (in localtime.c), not another one in zdump.c.

As I mentioned, zdump.c is intended to be useful even if localtime.c is not 
linked.  That is why it needs its own implementation.  See the comment about 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Port-localtime.c-s-gmtime-to-Visual-Studio-2013.patch
Type: text/x-diff
Size: 1074 bytes
Desc: not available
URL: <http://mm.icann.org/pipermail/tz/attachments/20150730/8b9ef535/0001-Port-localtime.c-s-gmtime-to-Visual-Studio-2013.patch>

More information about the tz mailing list