Message-Id: <199810080958.LAA61750@ieva06.lanet.lv> From: "Andris Pavenis" To: Alexander Bokovoy Date: Thu, 8 Oct 1998 12:03:57 +0300 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Newbie to DJGPP wants to use namespaces. CC: djgpp AT delorie DOT com In-reply-to: <3441.981008@bspu.unibel.by> X-mailer: Pegasus Mail for Win32 (v3.01b) Reply-To: djgpp AT delorie DOT com Date sent: Thu, 8 Oct 1998 10:36:23 +0200 From: Alexander Bokovoy 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 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