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]

(971016) i386-linux-gnulibc1 exception bug


Looks like exceptions fail unless I specify sjlj on i386-linux-gnulibc1.
Configured with "--enable-shared".

====== cut here
#include <iostream.h>

void foo (int i)
{
  if (i == 0)
    throw 5;
}

int main()
{
  try {
    foo (0);
  }
  catch(int x) {
    cerr << "Caught exception: " << x << endl;
    return 0;
  }
  return 1;
}

====== cut here

% c++ -o except except.cc
% ./except
Abort (core dumped)

% c++ -o except except.cc -fsjlj-exceptions
% ./except
Caught exception: 5

Regards,
Mumit -- khan@xraylith.wisc.edu
http://www.xraylith.wisc.edu/~khan/


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