Mail Archives: djgpp/1998/10/08/05:10:04
Date sent: Thu, 8 Oct 1998 10:36:23 +0200
From: Alexander Bokovoy <bokovoy AT bspu DOT unibel DOT by>
Subject: Re: Newbie to DJGPP wants to use namespaces.
> Andris Pavenis wrote:
> > Announcement of egcs-1.1 (see http://egcs.cygnus.com) says that
> > namespeces are fully supported in egcs-1.1. Currently DJGPP port
> > of egcs-1.1 is in alpha stage (mostly because I have build it only
> > with patched DJDEV202 (alpha) and for it, exceptions will not work
> > with DJDEV201 without some hacking). I'm working with it now for
> > more than a month.
> Are these problems have the same base as problems with exceptions in
> GCC 2.8.1 + BNU 2.8.1 (once exception was generated, application
> closed by abort() -- nevertheless of -fhandle-exceptions switch)? I
> know that new Robert's version of BNU 2.9.1 solves these problems for
> GCC 2.8.1. But when I tried to do the same for DJGPP 2.02+EGCS 1.1a (I
> followed all patches mentioned in readme) it fails for BNU 2.8.1 and
> for BNU 2.9.1 too. Symptoms are: application compiles without problem
> but crashes at run-time every time when throw() called.
Exceptions works Ok for me with egcs-1.1 and DJGPP 2.02
without any modifications. It was so with BNU 2.8.1 (I used earlier
it, only AS was patched to workaround local labels problem). Later
I took binutils-2.9.1.tar.gz from GNU distribution and cross-compiled
it for DJGPP under Linux and haven't met serious problems (I prefer
cross-comiling under Linux for big packages if it works: DJLSR202,
binutils, gdb-4.17 with Robert's patches, latest betas of GNUPLOT
are examples for that)
One thing I noticed with exceptions and egcs-1.1 is shown in
follwing example:
#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\n"; }
cout << "----------------\n";
try { x2(); } catch (xx w) { cout << "catched\n"; }
cout << "----------------\n";
return 0;
}
When I compile is with egcs-1.1 then the first exception is catched
but the second one aborts program. I don't know if this is a problem
with egcs-1.1. Even more: trying to debug this program with gdb is
unsuccessfull (already first exception crashes program under gdb).
Perhaps I should test the same example under Linux (I haven't
done it yet as I'm normally not using exceptions).
> > I have not really tested namespaces with egcs-1.1 so I cannot say
> > more.
> I am using namespaces in the SWORD 3.0. As far as I can see, EGCS 1.1
> works with them without any problems (I have used EGCS 1.1 under
> CygWin32) and they are really help to isolate different libraries from
> name intersections.
>
Andris
- Raw text -