This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Throw/Catch not working in SO?


Hi all,

I'm using some exception handling in a shared object, and while the
throw()/catch() works in both Windows and FreeBSD (using GCC 2.96), in Linux
(GCC 3.02 --enable-shared --enable-threads=posix) the throw is executed, and
the catch never happens.

For example... let's say I have the following code in the shared object...

void error() {
	throw(1);
}

void error2() {
	error();
}

void function() {
	try {
		if (blah)
			error2();
	}
	catch(...) {
		printf("exception caught");
	}
}

I know that error2() is being called and the exception is being thrown...
but it's not being caught at all.

Does anyone have ANY ideas?

Thanks.

- Charles



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