Iana build failures on Windows
Hello Paul, I have hit a compile error for zic.c on Windows. Git commit 9e0bf0b42d68b3d9ad0bc7ff70fc92d87f8b40d2 zic.c zic.c(152): error C2081: 'mode_t': name in formal parameter list illegal zic.c(2437): warning C4116: unnamed type definition in parentheses NMAKE : U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\bin\HostX64\x64\cl.EXE"' : return code '0x2' Stop. Can you please advise? Please do not release a new version with this issue present. Thank you! Regards Manuela Friedrich
On 2025-10-17 03:47, Manuela Friedrich wrote:
I have hit a compile error for zic.c on Windows.
Git commit 9e0bf0b42d68b3d9ad0bc7ff70fc92d87f8b40d2
zic.c zic.c(152): error C2081: 'mode_t': name in formal parameter list illegal
Thanks for reporting the problem. I want to fix this before the next release. Could you explain how zic.c line 152 is reached? On MS-Windows, HAVE_DIRECT_H should be defined (via -DHAVE_DIRECT_H in CFLAGS), and this should define 'mkdir' as a macro in line 48 of zic.c. Since line 152 is protected by "#ifndef mkdir", line 152 should not be reached on MS-Windows. If you are compiling in an MS-Windows environment where <direct.h> should not be used and a POSIX-like environment is supplied instead, then CFLAGS should not contain -DHAVE_POSIX_DECLS=0, and this would be another reason that zic.c line 152 should not be reached. It sounds like you're doing the latter, so could you please try compiling without -DHAVE_POSIX_DECLS=0? Or if my diagnosis is incorrect, please tell me where I went wrong.
Hi Paul, since the repository is hosted on GitHub (https://github.com/eggert/tz), would you accept patches that would set up a simple GitHub workflow that would build on several platforms/configurations on commit, so as to prevent such regressions going unnoticed? GitHub provides the actions/workflows for free, I find them quite handy in tzdata (e.g. https://github.com/python/tzdata/blob/master/.github/workflows/tests.yml) and other projects. Best Regards, Stan Ulbrych
On 2025-10-17 13:08, Stan Ulbrych via tz wrote:
would you accept patches that would set up a simple GitHub workflow that would build on several platforms/configurations on commit, so as to prevent such regressions going unnoticed?
Something like that could be useful, yes. Would the patches need to change existing build procedures (that might be a heavier lift)?
They wouldn't change anything in the existing build procedures, it would be equivalent to adding a text file. Running the workflows locally is not possible. An example run in CPython: https://github.com/python/cpython/actions/runs/18608572562/job/53062605328
Hello Paul, I pulled your latest changes first and got many of these errors: zic.c(173): error C2081: 'mode_t': name in formal parameter list illegal zic.c(176): error C2061: syntax error: identifier 'umask' zic.c(176): error C2059: syntax error: ';' zic.c(2465): warning C4116: unnamed type definition in parentheses NMAKE : U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\bin\HostX64\x64\cl.EXE"' : return code '0x2' Stop. We are using tools.ini with: CFLAGSW = /Zi -DHAVE_SYS_WAIT_H=0 -DHAVE_UNISTD_H=0 -DHAVE_INTTYPES_H=0 -DHAVE_POSIX_DECLS=0 -DHAVE_LINK=0 -DHAVE_SYMLINK=0 -DHAVE_DECL_ASCTIME_R=0 -Dssize_t=int -DHAVE_STRTOLL=0 -DRESERVE_STD_EXT_IDS -DSUPPRESS_TZDIR -DHAVE_TZNAME=1 -DZIC_BLOAT_DEFAULT="""fat""" -DHAVE_SETENV=0 After removing -DHAVE_POSIX_DECLS=0 we got these failures zic.c(1138): error C2065: 'optarg': undeclared identifier zic.c(1146): error C2065: 'optind': undeclared identifier Any other suggestions? Thank you! On Sat, Oct 18, 2025 at 8:15 PM Paul Eggert <eggert@cs.ucla.edu> wrote:
Also I installed the attached, which I hope ameliorate the issue.
On 2025-10-20 05:00, Manuela Friedrich wrote:
After removing -DHAVE_POSIX_DECLS=0 we got these failures
Instead of removing -DHAVE_POSIX_DECLS=0, please add -DHAVE_DIRECT_H; this should fix the mkdir part of the problem. Also, I just now installed the attached patch to address the umask part of the problem; please give it a try. Thanks for following up on this.
Hello Paul, zic.c compiled but I am now getting localtime.c(383): error C2065: 'uid_t': undeclared identifier localtime.c(383): error C2146: syntax error: missing ';' before identifier 'ruid' localtime.c(383): error C2065: 'ruid': undeclared identifier localtime.c(383): error C2065: 'euid': undeclared identifier localtime.c(383): error C2065: 'suid': undeclared identifier localtime.c(384): error C2065: 'gid_t': undeclared identifier localtime.c(384): error C2146: syntax error: missing ';' before identifier 'rgid' localtime.c(384): error C2065: 'rgid': undeclared identifier localtime.c(384): error C2065: 'egid': undeclared identifier localtime.c(384): error C2065: 'sgid': undeclared identifier localtime.c(385): error C2065: 'ruid': undeclared identifier localtime.c(385): error C2065: 'euid': undeclared identifier localtime.c(385): error C2065: 'suid': undeclared identifier localtime.c(386): error C2065: 'ruid': undeclared identifier localtime.c(386): error C2065: 'euid': undeclared identifier localtime.c(386): error C2065: 'suid': undeclared identifier localtime.c(388): error C2065: 'rgid': undeclared identifier localtime.c(388): error C2065: 'egid': undeclared identifier localtime.c(388): error C2065: 'sgid': undeclared identifier localtime.c(389): error C2065: 'rgid': undeclared identifier localtime.c(389): error C2065: 'egid': undeclared identifier localtime.c(389): error C2065: 'sgid': undeclared identifier localtime.c(812): error C2039: 'st_ctim': is not a member of 'stat' C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt\sys/stat.h(89): note: see declaration of 'stat' NMAKE : U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\bin\HostX64\x64\cl.EXE"' : return code '0x2' Stop. Any ideas? Thank you! On Mon, Oct 20, 2025 at 6:26 PM Paul Eggert <eggert@cs.ucla.edu> wrote:
On 2025-10-20 05:00, Manuela Friedrich wrote:
After removing -DHAVE_POSIX_DECLS=0 we got these failures
Instead of removing -DHAVE_POSIX_DECLS=0, please add -DHAVE_DIRECT_H; this should fix the mkdir part of the problem.
Also, I just now installed the attached patch to address the umask part of the problem; please give it a try.
Thanks for following up on this.
On 2025-10-21 06:15, Manuela Friedrich wrote:
localtime.c(383): error C2065: 'uid_t': undeclared identifier
Please compile with these flags too: -DHAVE_GETEUID=0 -DHAVE_GETRESUID=0 -DHAVE_STRUCT_STAT_ST_CTIM=0 tzcode assumes a POSIX-like platform, and if you're on a non-POSIX platform you need to use flags telling tzcode which POSIX-required features are missing. tzcode has long had flags like these, such as the -DHAVE_INTTYPES_H=0 and -DHAVE_UNISTD_H=0 flags you're already using. The flags I listed above are new since 2025b; this is documented in the Makefile. By the way, why compile with -DHAVE_INTTYPES_H=0? The Microsoft website says MS-Windows has <inttypes.h> [1]. I suggest removing that flag. Similarly, while compile with -DHAVE_STRTOLL=0? [2] PS. Getting back to umask, it looks we'll need it after all, to get a FreeBSD-like zic -u option to work securely. Please check whether the attached patch compiles for you. I haven't installed it, but plan to install something like it soon. [1]: https://learn.microsoft.com/en-us/cpp/c-runtime-library/standard-types [2]: https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/strtoll-st...
Hello Paul I was able to compile everything after adding -DHAVE_GETEUID=0 -DHAVE_GETRESUID=0 -DHAVE_STRUCT_STAT_ST_CTIM=0 Additionally things compiled after removing -DHAVE_INTTYPES_H=0 -DHAVE_STRTOLL=0 I was not able to apply your patch. If you could just commit the cange I can test head revision again. Thank you! On Tue, Oct 21, 2025 at 5:54 PM Paul Eggert <eggert@cs.ucla.edu> wrote:
On 2025-10-21 06:15, Manuela Friedrich wrote:
localtime.c(383): error C2065: 'uid_t': undeclared identifier
Please compile with these flags too:
-DHAVE_GETEUID=0 -DHAVE_GETRESUID=0 -DHAVE_STRUCT_STAT_ST_CTIM=0
tzcode assumes a POSIX-like platform, and if you're on a non-POSIX platform you need to use flags telling tzcode which POSIX-required features are missing. tzcode has long had flags like these, such as the -DHAVE_INTTYPES_H=0 and -DHAVE_UNISTD_H=0 flags you're already using. The flags I listed above are new since 2025b; this is documented in the Makefile.
By the way, why compile with -DHAVE_INTTYPES_H=0? The Microsoft website says MS-Windows has <inttypes.h> [1]. I suggest removing that flag. Similarly, while compile with -DHAVE_STRTOLL=0? [2]
PS. Getting back to umask, it looks we'll need it after all, to get a FreeBSD-like zic -u option to work securely. Please check whether the attached patch compiles for you. I haven't installed it, but plan to install something like it soon.
[1]: https://learn.microsoft.com/en-us/cpp/c-runtime-library/standard-types [2]:
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/strtoll-st...
On 2025-10-23 05:12, Manuela Friedrich wrote:
If you could just commit the cange I can test head revision again.
I committed a fancier version of the change (attached) along with some other changes, some of which are related to this issue. Please give the latest head a try. Thanks.
Hello Paul as of rev 6127d3755bb41960a500818e8e26b59bb98debb7 I get these errors: zic.c(104): error C2061: syntax error: identifier 'creat_perms' zic.c(104): error C2059: syntax error: ';' zic.c(104): error C2513: ' ': no variable declared before '=' zic.c(787): error C2143: syntax error: missing '{' before 'const' zic.c(788): error C2061: syntax error: identifier 'output_mode' zic.c(788): error C2059: syntax error: ';' zic.c(788): error C2513: ' ': no variable declared before '=' zic.c(791): error C2061: syntax error: identifier 'mode_option' zic.c(791): error C2059: syntax error: ';' zic.c(791): error C2059: syntax error: '<parameter-list>' zic.c(813): error C2065: 'output_mode': undeclared identifier zic.c(907): error C2065: 'mode_t': undeclared identifier zic.c(907): error C2146: syntax error: missing ';' before identifier 'omode' zic.c(907): error C2065: 'omode': undeclared identifier zic.c(908): error C2065: 'output_mode': undeclared identifier zic.c(909): error C2065: 'mode_t': undeclared identifier zic.c(909): error C2146: syntax error: missing ';' before identifier 'cmask' zic.c(909): error C2065: 'cmask': undeclared identifier zic.c(910): error C2065: 'cmask': undeclared identifier zic.c(911): error C2065: 'omode': undeclared identifier zic.c(911): error C2065: 'cmask': undeclared identifier zic.c(913): error C2065: 'omode': undeclared identifier zic.c(913): error C2065: 'output_mode': undeclared identifier zic.c(918): error C2065: 'creat_perms': undeclared identifier zic.c(918): error C2065: 'omode': undeclared identifier zic.c(921): error C2065: 'omode': undeclared identifier zic.c(927): error C2065: 'creat_perms': undeclared identifier zic.c(927): error C2065: 'omode': undeclared identifier zic.c(928): error C2065: 'output_mode': undeclared identifier zic.c(928): error C2065: 'omode': undeclared identifier zic.c(1288): error C2065: 'output_mode': undeclared identifier zic.c(1290): error C2065: 'output_mode': undeclared identifier zic.c(1610): error C2065: 'creat_perms': undeclared identifier zic.c(2667): warning C4116: unnamed type definition in parentheses NMAKE : U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\bin\HostX64\x64\cl.EXE"' : return code '0x2' Stop. Regards Manuela Friedrich On Fri, Oct 24, 2025 at 9:41 AM Paul Eggert <eggert@cs.ucla.edu> wrote:
On 2025-10-23 05:12, Manuela Friedrich wrote:
If you could just commit the cange I can test head revision again.
I committed a fancier version of the change (attached) along with some other changes, some of which are related to this issue. Please give the latest head a try. Thanks.
On 2025-10-24 04:25, Manuela Friedrich wrote:
zic.c(104): error C2061: syntax error: identifier 'creat_perms'
Thanks again. I see that your platform has sys/stat.h but it does not define mode_t as per POSIX. Let's try the attached proposed patch, which I installed in the development repo. This simplifies the code a bit. The idea is that we know how gid_t, mode_t and uid_t work on MS-Windows-like platforms that have <direct.h>: the types are unsigned short so let's just use that as a convenience (though it puzzles me why Microsoft doesn't do that for us). On other non-POSIX platforms we can continue to ask the builder to use something like -Dmode_t=int. (This would be needed if a mad scientist built tzcode on UNIX System III or earlier!)
"I'm not mad, I'm disappointed." --The Scientist @dashdashado On Fri, Oct 24, 2025, 12:00 PM Paul Eggert via tz <tz@iana.org> wrote:
On 2025-10-24 04:25, Manuela Friedrich wrote:
zic.c(104): error C2061: syntax error: identifier 'creat_perms'
Thanks again. I see that your platform has sys/stat.h but it does not define mode_t as per POSIX. Let's try the attached proposed patch, which I installed in the development repo. This simplifies the code a bit.
The idea is that we know how gid_t, mode_t and uid_t work on MS-Windows-like platforms that have <direct.h>: the types are unsigned short so let's just use that as a convenience (though it puzzles me why Microsoft doesn't do that for us). On other non-POSIX platforms we can continue to ask the builder to use something like -Dmode_t=int. (This would be needed if a mad scientist built tzcode on UNIX System III or earlier!)
Hello Paul, With current head rev I am getting a link failure: zic.obj : error LNK2019: unresolved external symbol fchmod referenced in function chmetadata zic.exe : fatal error LNK1120: 1 unresolved externals NMAKE : U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\bin\HostX64\x64\cl.EXE"' : return code '0x2' Stop. Regards Manuela Friedrich On Fri, Oct 24, 2025 at 6:00 PM Paul Eggert <eggert@cs.ucla.edu> wrote:
On 2025-10-24 04:25, Manuela Friedrich wrote:
zic.c(104): error C2061: syntax error: identifier 'creat_perms'
Thanks again. I see that your platform has sys/stat.h but it does not define mode_t as per POSIX. Let's try the attached proposed patch, which I installed in the development repo. This simplifies the code a bit.
The idea is that we know how gid_t, mode_t and uid_t work on MS-Windows-like platforms that have <direct.h>: the types are unsigned short so let's just use that as a convenience (though it puzzles me why Microsoft doesn't do that for us). On other non-POSIX platforms we can continue to ask the builder to use something like -Dmode_t=int. (This would be needed if a mad scientist built tzcode on UNIX System III or earlier!)
Hello Paul, That helped. Thank you! Regards Manuela Friedrich On Mon, Oct 27, 2025 at 9:58 PM Paul Eggert <eggert@cs.ucla.edu> wrote:
On 2025-10-27 01:16, Manuela Friedrich wrote:
zic.obj : error LNK2019: unresolved external symbol fchmod referenced in function chmetadata
Please add -DHAVE_FCHMOD=0 to your CFLAGS, as documented in the Makefile.
participants (4)
-
Arthur Olson -
Manuela Friedrich -
Paul Eggert -
Stan Ulbrych