Name Mangling - Name Mangling in C++

Name Mangling in C++

C++ compilers are the most widespread users of name mangling. The first C++ compilers were implemented as translators to C source code, which would then be compiled by a C compiler to object code; because of this, symbol names had to conform to C identifier rules. Even later, with the emergence of compilers which produced machine code or assembly directly, the system's linker generally did not support C++ symbols, and mangling was still required.

The C++ language does not define a standard decoration scheme, so each compiler uses its own. C++ also has complex language features, such as classes, templates, namespaces, and operator overloading, that alter the meaning of specific symbols based on context or usage. Meta-data about these features can be disambiguated by mangling (decorating) the name of a symbol. Because the name-mangling systems for such features are not standardized across compilers, few linkers can link object code that was produced by different compilers.

Read more about this topic:  Name Mangling

Famous quotes containing the word mangling:

    How can anyone be interested in war?—that glorious pursuit of annihilation with its ceremonious bellowings and trumpetings over the mangling of human bones and muscles and organs and eyes, its inconceivable agonies which could have been prevented by a few well- chosen, reasonable words. How, why, did this unnecessary business begin? Why does anyone want to read about it—this redundant human madness which men accept as inevitable?
    Margaret Anderson (1886–1973)