Mail Archives: djgpp/1998/12/19/13:12:17
On 19 Dec 98, at 0:17, Serge Slepov wrote:
> To : <djgpp AT delorie DOT com>
> From: Serge Slepov <sergeslepov AT hotmail DOT com>
> 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 <stdio.h>
>
> 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;
> }
>
- Raw text -