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). Regards, Kees -----Original Message----- From: Paul Eggert [mailto:eggert@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 USE_LTZ.