[tz] suggestions for potential code improvements?
eggert at cs.ucla.edu
Wed Jul 29 01:45:45 UTC 2015
Kees Dekker wrote:
> Both date.c, zdump.c, zic.c contain a number of static functions where the declaration differs from the implementation. This applies to:
> Date.c: wildinput(), oops(), display(), timeout(), iffy().
> Zdump.c: yeartot()
> Zic.c: dolink(),itsdir(),inrule(),inzone(),inzcont().
Thanks, should be fixed in the attached proposed patch (installed on Github).
> I also found that Visual Studio is the compiler that reports (line numbers corrected to match with your sources):
> 1>w:\logic\tz\zdump.c(970): error C4295: 'wday_name' : array is too small to include a terminating null character
> 1>w:\logic\tz\zdump.c(974): error C4295: 'mon_name' : array is too small to include a terminating null character
As mentioned earlier there is no bug there. the compiler is merely complaining
about style, and pacifying the compiler will require making the code a little
larger at run-time; so let's leave the code alone.
> Some other remarks of the previous email (like gmtime_r() does not exist on Windows, and regarding conversion errors from size_t to int) also exist in the previously mentioned 3 source files, but I first like to know your thoughts regarding the mail below before I will provide additional feedback.
For warnings about implicit conversions I wouldn't worry unless there is a real
bug. I don't see why MS-Windows' lack of support for gmtime_r is a problem:
tzcode supplies its own gmtime_r implementation and this implementation should work.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 3558 bytes
Desc: not available
More information about the tz