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

Boris Kolpackov commented on XERCESC-1800:
------------------------------------------

Alberto already made a round of changes so if, for example, you look at 
XMLString in the 3.0.0 codebase, you will see that all string sizes and indexes 
are passed as XMLSize_t. The same is in DOMCharacterData. It is just there are 
still some areas where we use int/long, for example as offsets in XMLString 
(should be changed to XMLSSize_t) and in DOMNodeList. It doesn't make sense to 
fix only some of the places.

The problem with using 32-bit integers where 64-bit should be use is that it 
makes it very hard to write 64-bit safe application that use Xerces-C++. Every 
time you need to pass std::size_t from your code to Xerces-C++, you have to 
cast or will get a warning.

Plus we never know how much RAM boxes in a couple of years will have and what 
users will want to do with that RAM.


> DOM API is not 64-bit safe
> --------------------------
>
>                 Key: XERCESC-1800
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1800
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: DOM
>    Affects Versions: 3.0.0
>            Reporter: Boris Kolpackov
>            Priority: Blocker
>             Fix For: 3.0.0
>
>
> There are a number of places in DOM where unsigned int and unsigned long are 
> used for indexes and sizes. These should be changed to XMLSize_t. Here is the 
> grep result:
> DOMDocument.hpp:                                                  const 
> unsigned long lineNum,
> DOMDocument.hpp:                                                  const 
> unsigned long columnNum) = 0;
> DOMDocumentTraversal.hpp:                                                   
> unsigned long    whatToShow,
> DOMDocumentTraversal.hpp:                                               
> unsigned long     whatToShow,
> DOMLocator.hpp:    virtual unsigned long getLineNumber() const = 0;
> DOMLocator.hpp:    virtual unsigned long getColumnNumber() const = 0;
> DOMLSParserFilter.hpp:    virtual unsigned long getWhatToShow() const = 0;
> DOMLSSerializerFilter.hpp:    virtual unsigned long getWhatToShow() const =0;
> DOMLSSerializerFilter.hpp:    //   unsigned long fWhatToShow;
> DOMNodeIterator.hpp:    virtual unsigned long      getWhatToShow() = 0;
> DOMTreeWalker.hpp:    virtual unsigned long     getWhatToShow()= 0;
> DOMTypeInfo.hpp:    virtual bool isDerivedFrom(const XMLCh* typeNamespaceArg, 
> const XMLCh* typeNameArg, unsigned long derivationMethod) const = 0;
> DOMXPathResult.hpp:     virtual unsigned long getSnapshotLength() const = 0;
> DOMXPathResult.hpp:     * @param index of type unsigned long - Index into the 
> snapshot collection.
> DOMXPathResult.hpp:     virtual const DOMNode* snapshotItem(unsigned long 
> index) const = 0;
> DOMImplementationList.hpp:    virtual DOMImplementation *item(unsigned int 
> index) const = 0;
> DOMImplementationList.hpp:    virtual unsigned int getLength() const = 0;
> DOMLSParser.hpp:    virtual const XMLCh* getURIText(unsigned int uriId) const 
> = 0;
> DOMNamedNodeMap.hpp:    virtual DOMNode     *item(unsigned int index) const = 
> 0;
> DOMNamedNodeMap.hpp:    virtual unsigned int getLength() const = 0;
> DOMNodeList.hpp:    virtual DOMNode  *item(unsigned int index) const = 0;
> DOMNodeList.hpp:    virtual unsigned int getLength() const = 0;
> DOMStringList.hpp:    virtual const XMLCh *item(unsigned int index) const = 0;
> DOMStringList.hpp:    virtual unsigned int getLength() const = 0;
> Ideally, we should do such an audit of the entire codebase.

-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to