Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-968

Warnings from AbstractDOMParser.hpp when compiling on HP

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.0
    • 2.3.0
    • Non-Validating Parser
    • 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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            john.hibbert@uk.ibm.com John Hibbert
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: