Mail Archives: djgpp/1996/08/29/07:56:09
On Wed, 28 Aug 1996 13:05:54 +0100 Ian Miller wrote:
>
> Mihai Moise wrote:
> >
> > Michael Day wrote:
> > >
> >
> > > 2.0? I'm doing something like this:
> > >
> > > try {
> > > throw 10;
> > > }
> > > catch (int i) {
> > >
> > > }
> > > catch (...) {
> > >
> > > }
> > >
> >
> > I have used the sigaction function in the file signal.h to catch
> > SIGSEGV, SIGTERM, etc... But I am unfamiliar with your syntax.
>
> That's because it is C++ syntax and it is for catching
> user exceptions rather than signals. I've just been trying this
> myself, and if gcc implements the mechanism I don't see why the
> above should not work. I know that I couldn't get it working
> either, though.
> --
I have done a code like
try
{ if(_error) throw "Error";}
catch(char *message)
{ cerr<<message<<endl;};
and compile it with the flag -fhandle-exception (?), it works fine.
There is a problem that you can not have an exception in a base class where the derived class has also an exception.
I have post this problem before, but the mail seems lost in the net.
C. N. Feng
- Raw text -