Date: Sat, 5 Sep 1998 11:35:47 +0200 (WET) From: Andris Pavenis To: Ignacio García Pérez cc: djgpp AT delorie DOT com Subject: Re: Help!!!, using exceptions. In-Reply-To: <35f041dc.1315962@MERCURIO> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Content-Transfer-Encoding: 8bit Precedence: bulk On Fri, 4 Sep 1998, Ignacio García Pérez wrote: > Hi, > > I just began today my very-first-stupid-program in C++ using > exceptions. I so simple just to check that the exception handling > mechanism is working. > > Well, it doesn't work. I compiled it using GCC 2.81, compiles with no > complaints but when I execute it, exits with an "Abort!" message when > the exception is thrown: > > #include > > void Test(int E) { > puts("Test-BEGIN"); > if (E) throw (E); > puts("Test-END"); > } > > void main(void) { > > puts("main-BEGIN"); > > try { Test(1); } > > catch (int E) { puts("catch (int E)"); } > catch (...) { puts("catch (...)"); } > > puts("main-END"); > } > > The output is: > "main-BEGIN" > "Test-BEGIN" > "Abort!" > > > As you can see, even if I was doing something wrong that caused the > integer exception not to be caught by the first "catch" block, the > next "catch(...)" should catch ALL exceptions. > > Any clues will be greatly appreciated. > Perhaps You can find them in gnu/gcc-2.81/problems.txt