[ 
https://issues.apache.org/jira/browse/XERCESC-2111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16116725#comment-16116725
 ] 

Roger Leigh edited comment on XERCESC-2111 at 8/7/17 3:15 PM:
--------------------------------------------------------------

I would personally be fine with STL and ostringstream or equivalent.  At worst, 
it increases the compile time of a few files slightly.  It's more portable than 
snprintf given Microsoft's previous lack of support for C and C99, so would be 
an obvious safe replacement.  I use them all the time without trouble, and you 
can even imbue streams with locales for more control over serialisation should 
we care about e.g. stable number formatting etc.


was (Author: rleigh):
I would personally be fine with STL and ostringstream or equivalent.  At worst, 
it increases the compile time of a few files slightly.  It's more portable than 
snprintf given Microsoft's previous lack of support for C and C99, so would be 
an obvious safe replacement.  I use them all the time without trouble, and you 
can even imbue streams with locales for more control over serialisation should 
be care about e.g. stable number formatting etc.

> Build failure with Windows and VS2013
> -------------------------------------
>
>                 Key: XERCESC-2111
>                 URL: https://issues.apache.org/jira/browse/XERCESC-2111
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Build
>    Affects Versions: 3.2.0
>         Environment: Windows Server 2008R2 with Visual Studio 2013
>            Reporter: Roger Leigh
>            Assignee: Scott Cantor
>             Fix For: 3.2.0
>
>
> snprintf isn't available before VS2015, though a Microsoft-specific variant 
> is available which we could use conditionally.  However, even this is not 
> present in earlier Visual Studio releases.  Do we strictly need to use 
> snprintf here?  If we do, how far back do our Visual Studio portability 
> requirements go?
> {{{
> 17:53:44 FAILED: C:\PROGRA~2\MICROS~3.0\VC\bin\amd64\cl.exe   /nologo /TP 
> -DHAVE_CONFIG_H=1 -DXERCES_BUILDING_LIBRARY=1 
> -DXERCES_DLL_NAME=\"xerces-c_3_2.dll\0\" -D_THREAD_SAFE=1 -Dxerces_c_EXPORTS 
> -I. 
> -ID:\build\OME-FILES-CPP-DEV-merge-win-superbuild\2a8f6256\build\xerces-source\src
>  -Isrc 
> -ID:\build\OME-FILES-CPP-DEV-merge-win-superbuild\2a8f6256\build\stage\include
>  /DWIN32 /D_WINDOWS /W3 /GR /EHsc /W3 /MD /O2 /Ob2 /DNDEBUG /showIncludes 
> /Fosrc\CMakeFiles\xerces-c.dir\xercesc\util\XMLDateTime.cpp.obj 
> /Fdsrc\CMakeFiles\xerces-c.dir\ /FS -c 
> D:\build\OME-FILES-CPP-DEV-merge-win-superbuild\2a8f6256\build\xerces-source\src\xercesc\util\XMLDateTime.cpp
> 17:53:44 
> D:\build\OME-FILES-CPP-DEV-merge-win-superbuild\2a8f6256\build\xerces-source\src\xercesc\util\XMLDateTime.cpp(471)
>  : warning C4244: 'initializing' : conversion from 'time_t' to 'unsigned 
> long', possible loss of data
> 17:53:44 
> D:\build\OME-FILES-CPP-DEV-merge-win-superbuild\2a8f6256\build\xerces-source\src\xercesc\util\XMLDateTime.cpp(473)
>  : warning C4244: 'initializing' : conversion from 'time_t' to 'unsigned 
> long', possible loss of data
> 17:53:44 
> D:\build\OME-FILES-CPP-DEV-merge-win-superbuild\2a8f6256\build\xerces-source\src\xercesc\util\XMLDateTime.cpp(475)
>  : warning C4244: 'initializing' : conversion from 'time_t' to 'unsigned 
> long', possible loss of data
> 17:53:44 
> D:\build\OME-FILES-CPP-DEV-merge-win-superbuild\2a8f6256\build\xerces-source\src\xercesc\util\XMLDateTime.cpp(477)
>  : warning C4244: 'initializing' : conversion from 'time_t' to 'unsigned 
> long', possible loss of data
> 17:53:44 
> D:\build\OME-FILES-CPP-DEV-merge-win-superbuild\2a8f6256\build\xerces-source\src\xercesc\util\XMLDateTime.cpp(480)
>  : error C3861: 'snprintf': identifier not found
> }}}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to