[wsf-c-dev] Use of C++

James Clark james at wso2.com
Wed Dec 6 21:24:33 PST 2006


On Thu, 2006-12-07 at 10:31 +0530, Damitha Kumarage wrote:
> James,
>  In one of your early mails I found the following
> "
> 
> We would hope to have Axis2/C eventually becoming a standard system
> shared library shipped with major distributions.  Binary application
> packages will use the binary of the shared library included with the
> distribution instead of their private version. This means we need to
> think seriously about not just API compatibility between versions but
> A*B*I compatibility between versions.  This is one of the big wins of C
> over C++: you can have real ABI compatibility."
> 
> So it seems that using C++ means some A*B*I compatiblity issues. 

Right.  I talked about this a bit:

> >A bigger issue is how you do the API.  One possibility is to do a pure C
> >API.  That is, you use extern "C", and the API looks exactly like an API
> >that would be provided by a library implemented in C.  This combined
> >with the above restrictions on C++ can give you a shared library that
> >is indistinguishable from something written in C. 

If your use of C++ is purely internal to the shared library, and your
API/ABI uses C++, then you avoid the ABI issues.  On the other hand, you
have to drop down to C, whenever you cross a shared-library boundary,
which can make crossing shared library boundaries expensive.  It makes
the decision about the position of boundaries between shared libraries
critical.

James








More information about the Wsf-c-dev mailing list