DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4581>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4581

erroneous static cast in programming examples

           Summary: erroneous static cast in programming examples
           Product: Xerces-C++
           Version: 1.5.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Documentation
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


http://xml.apache.org/xerces-c/program.html

The example code specifies (SAX2 Programming Guide):
> ContentHandler* contentHandler = new DefaultHandler();
> ErrorHandler* errHandler = (ErrorHandler*) contentHandler;

But the class hierarchy looks like:
class DefaultHandler : public ContentHandler, public ErrorHandler ...
so the cast from a ContentHandler * to an ErrorHandler * is wrong.

I would never have noticed this but the cast from ContentHandler * to
ErrorHandler * caused my code to run fine on its own, but break if I
ran it with Purify (Win2K, evaluation Purify 2001a).

This is an issue on all OS/Platform combos, as it is a C++ violation.

Thanks,
Dee Jay

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to