2016.05.09 06:48 "[Tiff] snprintf and MSVC 2015", by Mikhail

2016.05.09 20:45 "Re: [Tiff] snprintf and MSVC 2015", by Edward Lam

On 09/05/2016 3:29 PM, Roger Leigh wrote:

It would be useful to know what exactly HAVE_SNPRINTF is set to for these failing builds I can't reproduce.

- is it undefined, or set to a value

- should the above patch be undef'ing it if defined rather than defining to nothing?

HAVE_SNPRINTF is undefined in the case where it fails for me in Visual Studio

2015. Note that the actual value of HAVE_SNPRINTF does not matter since the code

testing for it doesn't look at its value.

It is odd that you're failing to reproduce the problem. Several other people and

myself can easily reproduce this problem so I think the reason why you're not

seeing this is because your build tools are not matching ours. Which Windows SDK

version are you using? Perhaps you're either not using Visual Studio 2015 and/or

an earlier Windows SDK version where snprintf() wasn't implemented yet. I've

attached a build log from by Visual Studio 2015 installation using the "VS2015

x64 Native Tools Command Prompt" start menu item and running "nmake /f Makefile.vc".

-Edward

Microsoft (R) Program Maintenance Utility Version 14.00.23506.0

Copyright (C) Microsoft Corporation. All rights reserved.

        cd port
        nmake /nologo /f Makefile.vc
        cd..
        cd libtiff
        nmake /nologo /f Makefile.vc

        cl /nologo /Ox /MD /EHsc /W3 /D_CRT_SECURE_NO_DEPRECATE -I.    -DAVOID_WIN32_FILEIO -DCHECK_JPEG_YCBCR_SUBSAMPLING -DDEFAULT_EXTRASAMPLE_AS_ALPHA -DSTRIPCHOP_DEFAULT=TIFF_STRIPCHOP -DSTRIP_SIZE_DEFAULT=8192 -DLOGLUV_SUPPORT -DNEXT_SUPPORT -DTHUNDER_SUPPORT -DLZW_SUPPORT -DPACKBITS_SUPPORT -DCCITT_SUPPORT -DTIF_PLATFORM_CONSOLE -DFILLODER_LSB2MSB  /c tif_aux.c tif_close.c tif_codec.c tif_color.c tif_compress.c tif_dir.c tif_dirinfo.c tif_dirread.c tif_dirwrite.c tif_dumpmode.c tif_error.c tif_extension.c tif_fax3.c tif_getimage.c tif_jbig.c tif_jpeg.c tif_jpeg_12.c tif_ojpeg.c tif_flush.c tif_luv.c tif_lzw.c tif_next.c tif_open.c tif_packbits.c tif_pixarlog.c tif_predict.c tif_print.c tif_read.c tif_swab.c tif_strip.c tif_thunder.c tif_tile.c tif_version.c tif_warning.c tif_write.c tif_zip.c tif_unix.c 

tif_aux.c

C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition c:\cygwin\home\edward\src\libtiff\libtiff\tiffiop.h(62): note: see previous definition of 'snprintf'

C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt\stdio.h(1927): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration tif_close.c

C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition c:\cygwin\home\edward\src\libtiff\libtiff\tiffiop.h(62): note: see previous definition of 'snprintf'

C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt\stdio.h(1927): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration tif_codec.c

C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition c:\cygwin\home\edward\src\libtiff\libtiff\tiffiop.h(62): note: see previous definition of 'snprintf'

C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt\stdio.h(1927): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration tif_color.c

C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition c:\cygwin\home\edward\src\libtiff\libtiff\tiffiop.h(62): note: see previous definition of 'snprintf'

C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt\stdio.h(1927): fatal error C1189: #error: Macro definition of snprintf conflicts with Standard Library function declaration tif_compress.c

C:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt\stdio.h(1925): warning C4005: 'snprintf': macro redefinition c:\cygwin\home\edward\src\libtiff\libtiff\tiffiop.h(62): note: see previous definition of 'snprintf'

C:\Program Files ({`e