[Expat-discuss] c++-ize expat
michal017 at centrum.sk
Mon Jun 30 17:38:02 EDT 2003
Give us an example..
On Mon, 30 Jun 2003 18:26:45 +0530
"Gururajan, Subhashini (Cognizant)" <GSubhash at chn.cognizant.com> wrote:
>Why is it that I get junk characters in handler sometimes. Because of this the parser fails. Please help me out. It is very inconsistent.
>Please ... somebody..
>From: m. [mailto:michal017 at centrum.sk]
>Sent: Wednesday, June 25, 2003 11:25 AM
>To: expat-discuss at libexpat.org
>Subject: Re: [Expat-discuss] c++-ize expat
>You know what? You are entirely right..
>This information was based on my colleague's knowledge, I should have tested
>it before I posted a question.. My apologies
>On Tue, 24 Jun 2003 23:29:01 +0100
>Graham Bennett <graham-expat at simulcra.org> wrote:
>>On Tue, Jun 24, 2003 at 02:38:21PM +0200, m. wrote:
>>> Hello.. I am wondering whether it is possible to c++-ize expat's code
>>> so that it could be compiled with c++ compiler. The reason for this
>>> is the ability to throw exceptions from callback functions. I have to
>>> remove all the 'extern "C"' stuff from expat code and cast all the
>>> void* to FILE* and so on.. Could this be done in the default expat's
>>In order to use expat from C++ code it is not necessary to compile with
>>g++. All that you need is to compile with gcc with the -fexceptions
>>flag. This generates the necessary stack unwinding code to allow
>>exceptions to be thrown.
>>IIRC, the expat configure script will enable the -fexceptions flag if it
>>detects the compiler is gcc (even though it checks for -fno-exceptions).
>>Try it and see.
>>I have used expat from C++ code compiled in this way and I've had no
>>problems throwing exceptions through expat code.
>Expat-discuss mailing list
>Expat-discuss at libexpat.org
More information about the Expat-discuss