Bug in throw() function suffix?

Andris Pavenis pavenis@lanet.lv
Tue Oct 13 01:46:00 GMT 1998


YAKUSH S E <yakush@ipmnet.ru> writes:
> 
> > I came across a strange bug(?) in egcs-1.1 (pgcc-2.91.57 19980901):
> 
> Using the *real* egcs (pgcc is not egcs) does not cause the program to 
> abort() on x86.  Please submit a bug report to the pgcc maintenance
> team.

Tested with both egcs-1.1 and pgcc-1.1 
(GNU C++ version pgcc-2.91.57 19980901 (egcs-1.1 release) (djgpp) compiled by GNU C version egcs-2.91.57 19980901 (egcs-1.1 release).) 
for DJGPP. 
Example worked Ok with both compilers. I haven't
tested this under Linux as I didn't build pgcc-1.1
for Linux.

However I found one different exception related
problem for both egcs-1.1 and pgcc-1.1 which looks appearing for DJGPP only:

#include <iostream>

class xx {};
void x1 (void) throw (xx) { xx a; throw(a); }
void x2 (void)            { xx a; throw(a); }

int main (void)
{
   try { x1(); } catch (xx w) 
     { cout << "catched from x1()\n"; }
   try { x2(); } catch (xx w) 
     { cout << "catched from x2()\n"; }
   return 0;
}

In this example only first exception is catched.
Second ends with SIGABRT. I have tested this
example under Linux (egcs-1.1 only) and it worked
Ok. 

Maybe the problem is COFF related as DJGPP uses 
this format and doesn't appear with ELF (or maybe some problem with binutils: I'm using 2.9.1) 

Andris



-----
See the original message at http://www.egroups.com/list/egcs-bugs/?start=7173
--
Free e-mail group hosting at http://www.eGroups.com/



More information about the Gcc-bugs mailing list