[OpenISO] The C++ standard
Std Lib0
stdlib0 at googlemail.com
Thu Sep 20 13:34:30 CEST 2007
On 9/16/07, Henrik Sundberg <storangen at gmail.com> wrote:
>
>
> My impression is that the C++ standard is overly complex as a result
> of different compiler vendors implementation. Instead of choosing,
> several ways to do the same thing are included in the standard.
Does anyone know more about this ABI incompatibility in different C++
implementations?
http://en.wikipedia.org/wiki/GObject
"Since there is no standard
ABI<http://en.wikipedia.org/wiki/Application_binary_interface>that
works across all C++ compilers, a library compiled with one C++
compiler is not always able to call a library compiled with a different one.
If such compatibility is required, the C++ methods must be exported as plain
C functions, partly defeating the purpose of the C++ object system. The
problem occurs because different C++ compilers use different kinds of name
mangling <http://en.wikipedia.org/wiki/Name_mangling> to ensure the
uniqueness of all exported symbols. (This is necessary because, for example,
two different classes may have identically named member functions, one
function name may be overloaded
<http://en.wikipedia.org/wiki/Overloading>multiple times, or
identically named functions may appear in different
namespaces <http://en.wikipedia.org/wiki/Namespace_%28computer_science%29>.)
In contrast, since C does not support any form of overloading or
namespacing, authors of C libraries will typically use explicit prefixes to
ensure the global uniqueness of their exported names. Hence, despite being
object-oriented, a GObject-based library written in C will always use the
same external symbol names regardless of which compiler is used."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://OpenISO.org/pipermail/discuss/attachments/20070920/fae50185/attachment.htm
More information about the Discuss
mailing list