This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

How do the exceptions work?


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@siframe.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@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]