Boost logo

Boost Users :

Subject: Re: [Boost-users] Exceptions and throwing across module boundaries
From: Josh Faust (jfaust_at_[hidden])
Date: 2009-11-11 19:50:27


On Wed, Nov 11, 2009 at 4:06 PM, Emil Dotchevski
<emildotchevski_at_[hidden]>wrote:

> On Wed, Nov 11, 2009 at 2:08 PM, Josh Faust <jfaust_at_[hidden]>
> wrote:
> > we hit a case where an exception thrown in one
> > module cannot be caught as anything but a std::exception in a module
> > compiled with different settings (same compiler -- gcc 4.2).
>
> The fact that catch(std::exception&) works for you is a coincidence.
>

Yeah, that was just an example.

>
> > Since we'd prefer to use exceptions rather than return codes as our error
> > reporting mechanism, I'm currently investigating possible solutions to
> > this. I was hoping to find something applicable boost, but it looks like
> > boost doesn't differentiate between throwing in a header vs. throwing in
> a
> > module -- for example, Boost.Thread has a few throw statements in cpp
> files
> > Is this just an issue that hasn't been enough of a problem to address?
>
> In general, a library might not work at all if its CPP files are
> compiled with different settings than the user code, even if it didn't
> throw any exceptions, because C and C++ do not define an ABI.
>

I suppose my impression was that exceptions are an even worse case -- but
now that I think about it we've run into other compiler setting ABI issues
before as well. Maybe this is a non-issue because we're not trying to
provide a perfectly clean interface (char* and other builtins only).

Thanks

Josh

>
> Emil Dotchevski
> Reverge Studios, Inc.
> http://www.revergestudios.com/reblog/index.php?n=ReCode
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net