This is the mail archive of the gcc-help@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]

g++ question about exceptions


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


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