Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.2.0
-
None
-
Operating System: Other
Platform: HP
-
22019
Description
I get the following warnings when compiling on HP:
Warning 749: "AbstractDOMParser.hpp", line 1533 # The cast
from 'xercesc_2_2::DOMDocument *' to 'xercesc_2_2::DOMDocumentImpl *' is
performed as a 'reinterpret_cast'. This operation is non-portable and
potentially unsafe.
Warning 740: "AbstractDOMParser.hpp", line 1533 # Unsafe cast between
pointers/references to incomplete classes: casting 'xercesc_2_2::DOMDocument
*' to 'xercesc_2_2::DOMDocumentImpl *'.
This corresponds to the following code:
inline void AbstractDOMParser::setDocument(DOMDocument* toSet)
{
fDocument = (DOMDocumentImpl *) toSet; // this is line 1533
}
The problem is that although DOMDocumentImpl inherits from DOMDocument,
this header does not know that (DOMDocumentImpl is only specified with
a forward declaration) and so a reinterpret_cast has to be used.
The reinterpret_cast can be avoided if the DOMDocumentImpl.hpp header
is included.