| delorie.com/archives/browse.cgi | search |
| Message-Id: | <199810081402.QAA36748@ieva06.lanet.lv> |
| From: | "Andris Pavenis" <pavenis AT lanet DOT lv> |
| To: | djgpp-workers AT delorie DOT com |
| Date: | Thu, 8 Oct 1998 16:07:43 +0300 |
| MIME-Version: | 1.0 |
| Subject: | problems with exceptions in egcs-1.1 (DJGPP) |
| CC: | egcs AT cygnus DOT com |
| X-mailer: | Pegasus Mail for Win32 (v3.01b) |
| Reply-To: | djgpp-workers AT delorie DOT com |
Hi!
Looks that there is problems with exceptions in DJGPP port of egcs-1.1.
The following example works Ok when compiled with DJGPP port of
gcc-2.8.1 and also with egcs-1.1 under Linux. It fails with both egcs-1.1
release and pgcc-1.1 release under DJGPP as last to exceptions are not
catched. It is when throw(<type>) is not included in prototype of procedure.
-------------------------------------------------------------------------------------
#include <iostream>
class xx {};
void x1 (void) throw (xx) { xx a; throw(a); }
void x2 (void) { xx a; throw(a); }
void x3 (void) { int i=1; throw(i); }
int main (void)
{
try { x1(); } catch (xx w) { cout << "catched from x1()\n"; }
cout << "----------------\n";
try { x1(); } catch (xx w) { cout << "catched from x1() once more\n"; }
cout << "----------------\n";
try { x3(); } catch (int i) { cout << "catched from x3()\n"; }
cout << "----------------\n";
try { x2(); } catch (xx w) { cout << "catched from x2()\n"; }
cout << "----------------\n";
return 0;
}
---------------------------------------------------------------------------
Andris
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |