Message-ID: From: "Andris Pavenis" To: "Serge Slepov" , djgpp AT delorie DOT com Date: Sat, 19 Dec 1998 19:55:46 +0200 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: does djgpp support exceptions? In-reply-to: <19981219081705.17476.qmail@hotmail.com> X-mailer: Pegasus Mail for Win32 (v3.01d) Reply-To: djgpp AT delorie DOT com On 19 Dec 98, at 0:17, Serge Slepov wrote: > To : > From: Serge Slepov > Subj: does djgpp support exceptions? > Yes (beginning with gcc-2.8.1) > > hi there, > > my question is: does djgpp support exceptions? (you know, try{} > catch{}... ) > I tried to run a simple example program but it seems not to catch the > exception at all, it only says `Abort!' and stops. > Seems that You have some installation problem as Your example works Ok with both gcc-2.8.1 and newly released beta release of DJGPP port of egcs-1.1.1 (exceptions does not work very stable with latest, so You are warned) If You are still using DJGPP-2.01 (djdev201.zip) then please upgrade to 2.02. > > the code goes below..... > > #include > > int main( int argc, char *argv[] ) > { > try > { > if( argc == 1 ) > throw "Insufficient no. of arguments. "; > > printf("No exception generated.\n"); > return 0; > } > catch( const char * msg ) > { > printf("%s\n", msg ); > fflush(stdout); > } > > printf("continue here after exception.\n" ); > return 1; > } >