🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #42671

c++ EXCEPTION handling in 2.7.0

#42671
From: Henty Waker
Date: Tue, 07 Nov 1995 00:00
47 lines
1584 bytes
I'm trying to get exception handling working in gcc2.7.0 under Linux. It
doesn't yet seem to be documented, but I see there is an option
"-fhandle-exceptions" so I imagine it must be implemented. However I can't
get it working. Here's an example test programme (exceptions.cc) :

#include <stdlib.h>
#include <iostream.h>

class Array
{
  public:
    int test(int a) 
    { cout << "\nTesting " << a << "\n";
      if (a==0) throw xError();
      return 1;
    }

    class xError {};
};

int main()
{
  Array i;
  try
  { i.test(0); }

  catch (Array::xError)
  { cout << "\nAn 0 occured!\n";  }

  return 1;

}

Then I "gcc -fhandle-exceptions exceptions.cc -lg++" and I get ....
  exceptions.cc:41: Internal compiler error.
  exceptions.cc:41: Please submit a full bug report to
    ug-g++@prep.ai.mit.edu'.

Anyone got any ideas, cause I'd really like to get this working.

Thanks

----------------------------------------------------------
Henty Waker - Dept. of surveying - University of Cape Town
          e-mail: henty@foxbat.sur.uct.ac.za
----------------------------------------------------------
Technical Details
Message-ID: <47neae$ib2@ucthpx.uct.ac.za>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,b77d899faf918c5d,start
X-Google-Attributes: gid11318c,public
From: henty@foxbat.sur.uct.ac.za (Henty Waker)
Subject: c++ EXCEPTION handling in 2.7.0
Date: 1995/11/07
Message-ID: <47neae$ib2@ucthpx.uct.ac.za>
X-Deja-AN: 118873046
organization: University of Cape Town
keywords: exception try catch
newsgroups: gnu.gcc.help
summary: exception handling