[tz] suggestions for potential code improvements?

Kees Dekker Kees.Dekker at infor.com
Fri Jul 31 08:37:33 UTC 2015

Hi Paul,

Thanks again. When I'm back from holiday I will continue working on localtime.c (we have made some changes and I was checking how to add a LRU list).
If you like, I can share my findings (of course: once I've found something interesting that will improve the code).


-----Original Message-----
From: Paul Eggert [mailto:eggert at cs.ucla.edu] 
Sent: Thursday, July 30, 2015 22:49
To: Kees Dekker
Cc: Time zone mailing list
Subject: Re: [tz] suggestions for potential code improvements?

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 

More information about the tz mailing list