This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
problems with exceptions in egcs-1.1 (DJGPP)
- To: djgpp-workers at delorie dot com
- Subject: problems with exceptions in egcs-1.1 (DJGPP)
- From: "Andris Pavenis" <pavenis at lanet dot lv>
- Date: Thu, 8 Oct 1998 16:07:43 +0300
- CC: egcs at cygnus 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