Subject Re: [Firebird-Architect] External Engines (and Plugins)
Author Alex Peshkov
On Wednesday 25 June 2008 15:05, Adriano dos Santos Fernandes wrote:
> Vlad Khorsun escreveu:
> > Adriano dos Santos Fernandes :
> >> Dmitry Yemanov escreveu:
> >>> Adriano dos Santos Fernandes wrote:
> >>>> C++ libraries can throw exceptions and the plugin part (CppEngine.h)
> >>>> embedded on them deal with exceptions and translate to the Error
> >>>> object. There is no boundaries violation.
> >>>
> >>> Maybe Vlad meant to say that a properly implemented dynamic library
> >>> should never throw exceptions to the caller process.
> >
> > Yes. More - one library must never throw exceptions even to caller
> > library.
>
> My first contribution to open source projects was a patch to GCC/MinGW
> to allow exceptions throw/catch across EXE/DLLs boundaries. It was only
> possible using dynamic library versions of libstd++, but such version
> was not officially distributed as people worried about GPL issues. Also,
> MSVC exceptions can be throw across MSVC EXE/DLLs.

Well, 2 specially prepared libraries (same compiler, same C runtime) - yes.
They can. But they may be compiled with different compiler versions or even
different compilers, one or both may be linked statically with C runtime
(like libfbclient), etc. Therefore as a good rule of thumb - never let
exceptions cross library's boundary.