This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
g++ question about exceptions
- To: gcc-help at gcc dot gnu dot org
- Subject: g++ question about exceptions
- From: Dale E Martin <dmartin at cliftonlabs dot com>
- Date: Mon, 30 Apr 2001 11:35:18 -0400
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