CCTZ 2.0 Visual Studio 2015 / Windows compiler messages

84 views
Skip to first unread message

Susanne Meyer

unread,
Apr 8, 2016, 2:24:21 AM4/8/16
to cctz
Hi Greg,

congratulation to your major update of CCTZ 2.0.

I did compile CCTZ 2.0 on Windows using Microsoft Visual Studio 2015 and got following compiler messages:

1. time_zone_lookup.cc(32): error C2664: "errno_t _dupenv_s(char **,size_t *,const char *)" : Converting argument 1 from "char" to "char **" not possible

2. time_zone_libc.cc(72): error C4996: '__timezone': This function or variable may be unsafe. Consider using _get_timezone instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

3. time_zone_libc.cc(73): error C4996: '__tzname': This function or variable may be unsafe. Consider using _get_tzname instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

4. time_zone_impl.cc(107): warning C4244: "Argument": Conversion from "int64_t" to "int", possible data loss

5. time_zone_format.cc(734): warning C4244: "Argument": Conversion from "int64_t" to "int", possible data loss

Message 1:
time_zone_lookup.cc line 32:
_dupenv_s(*tz_env, nullptr, "TZ");  // original
_dupenv_s(&tz_env, nullptr, "TZ"); // changed the first parameter input and the error was gone

Message 2:
time_zone_libc.cc line 72+73:
At the beginning of the file infront of all header files I added following lines to solve this error:

#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#endif

Messages 4+5: Look for yourself. I did'nt notice any data loss. After fixing the first two message issues, CCTZ ran fine on Windows.

Susan

Bradley White

unread,
Apr 14, 2016, 1:07:16 AM4/14/16
to Susanne Meyer, cctz
Thanks again, Susan.  I believe I have now addressed all those issues, but I don't have a Windows development environment so please validate at your leisure.

Susanne Meyer

unread,
Apr 14, 2016, 6:29:08 AM4/14/16
to cctz, b...@acm.org
Hi Bradley,

I see, you fixed the issues from ground up - really well done! So now the error and warning messages are gone.

The test compile before was done with warning 'level 3' (default setting). If you are interested, switching the warning level to its highest setting 'level 4' a few other warnings were reported, which didn't show up on 'level 3':

1. time_zone_posix.cc(99): warning C4244: "=": Converting from "int" to "int8_t", possible data loss
2. time_zone_posix.cc(100): warning C4244: "=": Converting from "int" to "int8_t", possible data loss
3. time_zone_posix.cc(101): warning C4244: "=": Converting from "int" to "int8_t", possible data loss
4. cctz_test2\time_zone_posix.cc(109): warning C4244: "=": Converting from "int" to "int16_t", possible data loss
5. time_zone_posix.cc(115): warning C4244: "=": Converting from "int" to "int16_t", possible data loss
6. time_zone_info.cc(538): warning C4244: "Argument": Converting from "int" to "char", possible data loss

Microsoft MSDN documentation about warning C4244:
https://msdn.microsoft.com/en-us/library/th7a07tz.aspx

Bradley White

unread,
Apr 14, 2016, 6:21:16 PM4/14/16
to Susanne Meyer, cctz
On Thu, Apr 14, 2016 at 6:29 AM, 'Susanne Meyer' via cctz <cc...@googlegroups.com> wrote:
If you are interested, switching the warning level to its highest setting 'level 4' a few other warnings were reported, which didn't show up on 'level 3'

Thanks.  Those narrowing, but safe assignments should now have been quieted.

Resha Bansal

unread,
Jun 15, 2017, 5:47:26 AM6/15/17
to cctz, b...@acm.org
Hi All,

Can anyone mention whether it is compatible with visual studio 2012 ?
Secondly, when I am trying to download cctz library from github, How to check whether it is an updated version or not?

Thanks in advance.

Resha

Bradley White

unread,
Jun 15, 2017, 10:56:20 PM6/15/17
to cctz
On Thursday, June 15, 2017 at 5:47:26 AM UTC-4, Resha Bansal wrote:
Can anyone mention whether it is compatible with visual studio 2012 ?

I cannot confirm it, but nor do I know of a reason why it is not.  I'd suggest just trying it.
 
Secondly, when I am trying to download cctz library from github, How to check whether it is an updated version or not?

What do you mean by "an updated version?"  If you visit http://github.com/google/cctz you'll see that the latest commit is "0a5cc50".
Reply all
Reply to author
Forward
0 new messages