[tz] [PATCH] Support building zic.exe and zdump.exe natively on Windows with Visual Studio nmake.

Paul Eggert eggert at cs.ucla.edu
Thu Feb 8 05:53:55 UTC 2018


Manuela Friedrich wrote:
> In zdump localtime_r() was calling localtime() but it crashed after the return from localtime because there was no prototype for localtime

Why not? zdump.c includes private.h, which includes time.h, and that should 
should declare a prototype for localtime, according to this page:

https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/localtime-localtime32-localtime64

> Therefore it is crucial for us to have the dos specifier check in tzloadbody().
> This change won’t affect the behaviour on Unix and using a full path works fine on Unix.

It does affect the behavior on Unix, as file names like "a:b" are valid relative 
file names whereas the proposed code would treat them as absolute.

Can you use UNC names instead? Perhaps something starting with // will do the 
trick. Or if that doesn't work, perhaps you can set TZDIR=/ when running 'make', 
and then cd to the appropriate drive root before running zdump and/or zic and 
then use a path relative to that drive root. At any rate, I'm not sure it's a 
good idea for portable code to worry about these ins and outs of MS-Windows file 
name conventions.



More information about the tz mailing list