g++ question about exceptions
Dale E Martin
dmartin@cliftonlabs.com
Mon Apr 30 08:35:00 GMT 2001
Hi. I was curious if there is some way to coax g++ into warning me about
unhandled exceptions. For instance, if I have the following code:
// begin
#include <iostream.h>
class foo {
public:
foo(){}
~foo(){}
void doit() throw( int ) {
cout << "Har har" << endl;
throw 12;
}
};
int main( int argc, char *argv ){
foo *myFoo = new foo();
myFoo->doit();
exit(0);
}
// end
I'd like it to tell me "you're not handling the exception thrown by
"foo::doit"" at compile time. I realize that if this behavior isn't
specified by the standard, then it would have to be a special flag to the
compiler.
Thanks for any insight. I'm not subscribed to this list, please Cc me any
replies.
Thanks,
Dale
--
Dale E. Martin, Clifton Labs, Inc.
Senior Computer Engineer
dmartin@cliftonlabs.com
http://www.cliftonlabs.com
pgp key available
More information about the Gcc-help
mailing list