| re: Very strange try/catch problem. Please help!
Gianni Mariani <gi2nospam@mariani.ws> wrote in message news:<bjmlu9$rl3@dispatch.concentric.net>...[color=blue]
> Michael Kantarovich wrote:[color=green]
> > Hello,
> >
> > I have a class, that in all it's methods, following code won't reach
> > the catch statment!! All other classes in the project are working fine.
> >
> > ...
> >
> > try {
> > throw std::exception();
> > }
> > catch (...) {
> > cout << "I am here." << endl; //THIS LINE IS NEVER REACHED.
> > //IN STEAD OF REACHING THIS LINE,
> > //CONTROL IS PASSED TO HIGHER CATCH STATMENT
> > //IN THE CALLER, BUT NOT IN THIS CLASS/METHOD!
> > }
> >
> > ...
> >
> > I can't imagine what is wrong ... i tried a lot of things, all without any effect.
> >
> > I am using Solaris 8 and SunCC 5.5 (Compiler Collection 8).
> > Thanks a lot for help![/color]
>
> Suggestion: Post compilable code.
>
> The code below seems to do what you expect on GCC 3.3.1.
>
> I think you're right, I think this is a compiler bug. You'll need to get
> some help from SUN. Maybe they have a patch.
>
>
> #include <iostream>
>
>
> void foo()
> {
>
> try {
> throw std::exception();
> }
> catch (...) {
> std::cout << "I am here." << std::endl; //NOT REACHED.
>
> }
>
> }
>
>
> int main()
> {
>
> try {
> foo();
> }
> catch (...) {
> std::cout << "I OUTA am here." << std::endl;
> }
>
> }[/color]
Hi,
I found out that the problem is in one of my libraries, and others
work fine.
Does anyone has the experiense with SunCC 5.5 Compiler. It seems to me
that it is some kind of bug, but i can't find out what is it ... . |