delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/07/21/10:24:37

From: roumen AT siframe DOT de (Roumen Al. Dimitrov)
Subject: How do the exceptions work?
21 Jul 1998 10:24:37 -0700 :
Message-ID: <9807210852.AA17221.cygnus.gnu-win32@lima.siframe.de>
Reply-To: "Roumen Al. Dimitrov" <roumen AT siframe DOT de>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

Hallo,

I have written a small program as follows:

#include <fstream.h>

class e
	{
public:
	e (int i=0) {x=i;};
	~e () {};
	int x;
	};

void proc () throw (e)
	{
	throw e (3);
	}

void main ()
	{
	cout << "<enter>\n";
	cout.flush ();
try {
	proc ();
	}
catch (e x)
	{
	cerr << "exception occured: " << x.x << '\n';
	cerr.flush ();
	}
	cout << "\nOK\n";
	}

and here is the output:

<enter>
Aborted

Can you say me, how can I obtain something like:

<enter>
exception occured: 3
OK

which is much more correct? Under Unix and the older Cygnus GNU C 2.7.2.2 is
everything OK (well, not enough OK - it happens one Internal Compiler Error
because of the last line)
SIFRAME Software Technologies GmbH
Roumen Al. Dimitrov
Rottmannstrasse 7a
80333 Muenchen
Germany
mailto:roumen AT siframe DOT de
Telefon +49 89 523 70-77
Telefax +49 89 523 70-73
Info: http://www.siframe.de

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019