You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Boris Kolpackov (JIRA)" <xe...@xml.apache.org> on 2007/05/02 15:11:15 UTC

[jira] Commented: (XERCESC-1531) building for Windows-XP AMD64 has compile errors and warnings

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

Boris Kolpackov commented on XERCESC-1531:
------------------------------------------

In order to build a 64 bit version with this compiler one needs to change the definitions for XMLSize_t and XMLSSize_t in VCPPDefs.hpp since with this compiler long int is 32 bit even in 64 bit mode. After this change there are many more warnings (~200) and a couple of errors. The attached patch provides the neccessary changes for VCPPDefs.hpp and fixes the errors.

After studying the warnings (most of which are potential data loss related) it became clear that they are not Windows-specific. There is a multitude of places in Xerces-C++ where various sizes are passed as 32 bit integers while potentially being 64 bit wide. I grep'ed for "unsigned int" in the util directory and got over 2000 places most of which need to be changed to a 64 bit type. This appears to be a serious problem in Xerces-C++. I wonder if there are any plans to address this?


> building for Windows-XP AMD64 has compile errors and warnings
> -------------------------------------------------------------
>
>                 Key: XERCESC-1531
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1531
>             Project: Xerces-C++
>          Issue Type: New Feature
>          Components: Build
>    Affects Versions: 2.7.0
>         Environment: Windows XP AMD64 built with Visual Studio 2005 Final Version
>            Reporter: David Dunkle
>
> David Dunkle wrote:
> > We would like a working xerces-C++ for Windows XP 64, specifically 
> > AMD64. I am starting to try to build the source for this platform 
> > using Visual Studio 8 (Visual Studio 2005 - the final version), and I 
> > have some questions.
> >  
> > 1) I have seen one or two other people asking about this in the email 
> > archives, but before I go to far, I would like to know if anyone has 
> > gotten a functional xerces for 64 bit Windows.
> > 2) We would like to build with VC8, but there is no VC8 project in the 
> > 2.7.0 release. Should we plan on creating one?
> > 3) I have most of the subprojects now compiling and linking for me, 
> > without changing any source, but I still see 3 compile errors and many 
> > disturbing compiler warnings.
> >  
> > The warnings:
> >  
> > The most bothersome warnings seem to me to be those where "long" is 
> > assumed to be 64 bits; on this platform, I believe that long is 32 
> > bits even though pointers are 64. At least according to Microsoft's 
> > documentation. An example warning is below, but there are many more.
> >  
> > Configuration: Debug x64 ------
> > Compiling...
> > PSVIWriterHandlers.cpp
> > ..\..\..\..\..\src\xercesc/internal/XSerializeEngine.hpp(818)
> > : warning C4244: 'return' : conversion from '__int64'
> > to 'unsigned long', possible loss of data
> >  
> I've already prepared a patch for this warning, but it means a change in the public API, so it cannot go in until the 3.0 release.  For the time being, you can ignore it.
> > Is there a some way to deal with these kind of warnings that I don't 
> > understand built into xerces, or should we plan on changing the 
> > source? The problem seems pretty systemic.
> >  
> > Here are the errors.
> >  
> > Are there known solutions for these errors or should we plan on fixing 
> > the xerces source?
> >  
> > ------ Build started: Project: PSVIWriter,
> > Configuration: Debug x64 ------
> > Compiling...
> ...
> > ..\..\..\..\..\samples\PSVIWriter\PSVIWriterHandlers.cpp(1617)
> > : error C2440: 'type cast' : cannot convert from 
> > 'xercesc_2_7::XSObject *' to 'unsigned long'
> >         The target is not large enough
> The fix for this is a bit complicated, so I'll have to work on a fix for this.
> > Build log was saved at
> > "file://c:\ddunkleworkspace\mytests\xerces-c-src_2_7_0\Projects\Win32\VC8\xerces-all\PSVIWriter\x64\Debug\BuildLog.htm"
> > PSVIWriter - 1 error(s), 2 warning(s)
> > ------ Build started: Project: xml4com, Configuration:
> > Debug x64 ------
> > Compiling...
> > XMLHTTPRequest.cpp
> > ..\..\..\..\..\src\xercesc\com\XMLHTTPRequest.cpp(40)
> > : warning C4996: '_tcsncpy' was declared deprecated
> >         C:\Program Files (x86)\Microsoft Visual Studio
> > 8\VC\include\tchar.h(1467) : see declaration of '_tcsncpy'
> >         Message: 'This function or variable may be unsafe. Consider 
> > using _tcsncpy_s instead. To disable deprecation, use 
> > _CRT_SECURE_NO_DEPRECATE. See online help for details.'
> This is Microsoft's idea of a joke, I guess.  They are trying to become security conscious, so they decided to mark all sort of functions as "deprecated."  You can ignore these errors.  I will be checking in a fix that disables them.
> Also, I suspect you will have to disable the COM wrappers, because they will probably not build in 64-bit mode.  I don't think anyone is even maintaining them now, and I'm not sure if COM can work with 64-bit applications.
> ...
> > Build log was saved at
> > "file://c:\ddunkleworkspace\mytests\xerces-c-src_2_7_0\Projects\Win32\VC8\xerces-all\xerces-com\x64\Debug\BuildLog.htm"
> > xml4com - 2 error(s), 8 warning(s)
> > ------ Build started: Project: MemHandlerTest,
> > Configuration: Debug x64 ------
> > Compiling...
> > SimpleHashPtr.cpp
> > ..\..\..\..\..\tests\MemHandlerTest\SimpleHashPtr.cpp(32)
> > : error C2440: 'type cast' : cannot convert from 'const void *const ' 
> > to 'long'
> >         The target is not large enough
> The fix is to cast size_t instead of long.  I will check in a fix for this.
> If you want to track these fixes, feel free to create Jira enhancement request, and I'll make sure to update it when the fixes are in the SVN repository.
> Dave

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org