On Wed, Nov 11, 2009 at 4:06 PM, Emil Dotchevski
<emildotchevski@gmail.com> wrote:
On Wed, Nov 11, 2009 at 2:08 PM, Josh Faust <
jfaust@willowgarage.com> 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@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users