Board index » cppbuilder » C++ Exception Handling Problem

C++ Exception Handling Problem


2004-07-26 09:21:31 PM
cppbuilder70
Hello.
The code:
f1(){
...
string s;
throw xmsg("Error");
...
}
f2(){
try{
f1();
}
catch(...){}
}
cased a system run-time error (32 bits).
What have I done wrong??
Thanks AD.
 
 

Re:C++ Exception Handling Problem

"AD" < XXXX@XXXXX.COM >writes:
Quote
The code:
f1(){
...
string s;
throw xmsg("Error");
...
}

f2(){
try{
f1();
}
catch(...){}
}

cased a system run-time error (32 bits).
What have I done wrong??
That's hard to tell from the information you provide.
Please post the minimal, but complete program that demonstrates the
behavior that you are seeing. Which version of Borland C++ are you using?
 

Re:C++ Exception Handling Problem

Before I write a demo, maybe a few more details may help:
1. The same code when compiled as 16bits runs OK.
2. Unchecking "C++ Options/Exception Hadling/Enable destructor cleanup"
solves the problem(32bits).
3. I'm using BC++ 5.02.
Thanks.
"Thomas Maeder [TeamB]" < XXXX@XXXXX.COM >wrote in message
Quote
"AD" < XXXX@XXXXX.COM >writes:

>The code:
>f1(){
>...
>string s;
>throw xmsg("Error");
>...
>}
>
>f2(){
>try{
>f1();
>}
>catch(...){}
>}
>
>cased a system run-time error (32 bits).
>What have I done wrong??

That's hard to tell from the information you provide.

Please post the minimal, but complete program that demonstrates the
behavior that you are seeing. Which version of Borland C++ are you using?
 

{smallsort}

Re:C++ Exception Handling Problem

AD wrote:
Quote
Before I write a demo, maybe a few more details may help:
1. The same code when compiled as 16bits runs OK.
2. Unchecking "C++ Options/Exception Hadling/Enable destructor cleanup"
solves the problem(32bits).
3. I'm using BC++ 5.02.
Thanks.
Yes, there is a bug in BC5.02, read this:
personal.sirma.bg/Jogy/bc5x.html
--
Jogy
www.jogy.net/
XXXX@XXXXX.COM
 

Re:C++ Exception Handling Problem

Thanks a lot Jogy.
"Jogy" < XXXX@XXXXX.COM >wrote in message
Quote
AD wrote:
>Before I write a demo, maybe a few more details may help:
>1. The same code when compiled as 16bits runs OK.
>2. Unchecking "C++ Options/Exception Hadling/Enable destructor
cleanup"
>solves the problem(32bits).
>3. I'm using BC++ 5.02.
>Thanks.

Yes, there is a bug in BC5.02, read this:
personal.sirma.bg/Jogy/bc5x.html


--
Jogy
www.jogy.net/
XXXX@XXXXX.COM