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

Exception Handling broken?


Hi!

I compiled this code:

  #include <iostream.h>

  class foo { };

  main()
  {
    cerr << "if the program dumps core now, exception handling is flawed.\n";
    try {
      throw foo();
    } catch (foo &x) {
      cerr << "exception caught correctly!\n";
    } catch (...) {
      cerr << "exception not matched correctly!\n";
    }
  }

like this:

  $ g++ -o et et.C
  $ ./et
  if the program dumps core now, exception handling is flawed.
  zsh: 2861 segmentation fault (core dumped)  ./et
  $

Using -fno-rtti or -fsjlj-exceptions did not help at all.
Any suggestions?  BTW:

  $ gcc -v
  Reading specs from /usr/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.14p/specs
  gcc version egcs-2.90.14p 971023 (gcc2-970802 experimental)
  $

Felix


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