Moving C++ bindings in gmpxx.h into a namespace

Sam Varshavchik mrsam at courier-mta.com
Sun Jun 30 14:34:26 CEST 2013


Niels Möller writes:

> Sam Varshavchik <mrsam at courier-mta.com> writes:
>
> > Compatibility with existing code is trivial.
>
> What about binary compatibility? I imagine namespaces are involved in
> the symbol name mangling in some way?
>
> (I'm no C++ guy, so I don't have any strong opinion on whether or not
> it's a good idea to use namespaces in GMP).

Correct, and binary compatibility is lesser of an issue for C++ than it is  
for C. It's generally expected that C++ source is going to get recompiled  
after updating a library. See, for example:

http://boost.2283326.n4.nabble.com/ABI-and-API-compatibility-td2643120.html

Another data point: although recently gcc is trying to maintain its own  
libstdc++'s ABI compatibility across major branch releases, for a while the  
ABI was compatible only within a gcc branch release. Until some time ago,  
even if some particular C++ library's ABI remained the same, app code (and  
that library itself!) would need to be recompiled after updating gcc.

Additionally, gmpxx.so does not use versioning. This would also be a  
consideration to discuss, here.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://gmplib.org/list-archives/gmp-devel/attachments/20130630/57b54ef4/attachment.bin>


More information about the gmp-devel mailing list