[tz] Windows build failures

Manuela Friedrich Manuela.Friedrich at actian.com
Tue Dec 20 09:42:17 UTC 2022

Hello Paul,

I did feel like there was something up with restrict causing these issues.

#define restrict /* empty */ in private.h helped build everything successfully.

So I wonder if you can decouple the new condition to set restrict to empty as it is causing the windows issues.

#if PORT_TO_C89 && __STDC_VERSION__ < 199901 && !defined restrict
# define restrict /* empty */

We are compiling with nmake from Visual Studio 2017.
_MSC_VER is 1912
__STDC_VERSION__ is not defined

Manuela Friedrich

-----Original Message-----
From: Paul Eggert <eggert at cs.ucla.edu> 
Sent: Dienstag, 20. Dezember 2022 05:31
To: Manuela Friedrich <Manuela.Friedrich at actian.com>; tz at iana.org
Cc: Steven Shuriff <Steven.Shuriff at actian.com>
Subject: Re: Windows build failures

Oh, one more thing. If you compile with /std:c11 or /std:c17, does that fix the problem? If so, perhaps we should just recommend that somewhere. 
If not, I have some more questions:

How about if you instead compile with -DPORT_TO_C89?

I am asking these questions because of the following recently-changed code in private.h:

#if PORT_TO_C89 && __STDC_VERSION__ < 199901 && !defined restrict # define restrict /* empty */ #endif

Perhaps the "#define restrict /* empty */" is needed in your Microsoft-based setup.

I have some other questions about your compiler, assuming you don't use 
any of the above flags:

What is the value of __STDC_VERSION__ on your platform? And what is the 
value of _MSC_VER?

Does "#include <stdbool.h>" work?

Does "#include <inttypes.h>" work? How about "#include <stdint.h>"?

Is there a snprintf function?

More information about the tz mailing list