C++ exceptions causing terminate() in XML parsing

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

hoelzro
Just popping in
Just popping in
Posts: 8
Joined: Fri Apr 11, 2008 04:43

C++ exceptions causing terminate() in XML parsing

Postby hoelzro » Mon Jan 05, 2009 01:26

Hello everyone,

My application uses XML for some of its own configuration, so I figured I shouldn't reinvent the wheel and just use CEGUI's XML parser to do my parsing for me. So far, everything works fine and dandy, except when I throw an exception from one of XMLHandler's methods. I do this fairly often to ensure the validity of the current configuration. At runtime, the exception does not propagate to parseXMLFile(); rather, it causes terminate to be called. This only happens when using Expat or libxml, which I've noticed are non-C++ parsers. So I have a few questions:

    - Does C++ treat C functions as being implicitly declared throw ()?
    - What are some possible workarounds for this problem?


Thanks,
Rob Hoelz

EDIT: I've only been able to duplicate this on Mac OSX, version 10.5.5.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Mon Jan 05, 2009 09:50

Hi,

This report pretty much confirms an issue reported by someone else, so thanks for this as it saves me some aggro with testing and what have you :)

Original issue report: http://www.cegui.org.uk/phpBB2/viewtopic.php?t=3763
Mantis ticket: http://www.cegui.org.uk/mantis/view.php?id=254

I'm not sure about work-arounds / fixes at the moment, though one idea I had was basically to compile the C based parser dependency libs as C++ (actually probably just enabling exceptions would do the trick).

I'll get to fixing this shortly with any luck, but in the mean time if you come up with any pertinent info (especially as regards to exceptions passing through C funcs) please do post it here or on the mantis ticket :)

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 9 guests