> >The obvious solution is to have a layer that catches C++ exceptions
> >and returns appropriate flags. Another layer, separately compiled,
> >can throw Java exceptions.
>
> Do you have an idea of how difficult it would be to relax this
> restriction? Would it be possible to, say, only allow one type of
> exceptions to be *caught* in a given compilation unit? Or, could we
> make libgcj's personality routine handle C++ exceptions as well
> (for CNI code)?
Great question! I don't know. I think it would be possible to have
mixed exceptions.
> Currently, this does seem like a pretty nasty limitation for CNI.
I appreciate that there is some additional overhead, but it's pretty
small. Imagine the case where C++ throws foo_exception and the
wrapper catches foo_exception and propagates it as FooException. The
additional cost of testing a flag and passing it back would not be
great compared with the whole business of unwinding and allocating a
FooException.