and Tru64 has two name mangling schemes. The original, pre-standard scheme is known as the ARM model, and is based on the name mangling described in the C++ Annotated Reference Manual (ARM). With the advent of new features in standard C++, particularly templates, the ARM scheme became more and more unsuitable — it could not encode certain function types, or produced identically mangled names for different functions. It was therefore replaced by the newer "ANSI" model, which supported all ANSI template features, but was not backward compatible. On IA-64, a standard Application Binary Interface (ABI) exists (see external links), which defines (among other things) a standard name-mangling scheme, and which is used by all the IA-64 compilers. GNU GCC 3.x, in addition, has adopted the name mangling scheme defined in this standard for use on other, non-Intel platforms. The Visual Studio and Windows SDK include the program which prints the C-style function prototype for a given mangled name. On Microsoft Windows, the Intel compiler and Clang uses the Visual C++ name mangling for compatibility. Handling of C symbols when linking from C++ The job of the common C++ idiom: #ifdef __cplusplus extern "C" { #endif /* ... */ #ifdef __cplusplus } #endif is to ensure that the symbols within are "unmangled" – that the compiler emits a binary file with their names undecorated, as a C compiler would do. As C language definitions are unmangled, the C++ compiler needs to avoid mangling references to these identifiers. For example, the standard strings library, , usually contains something resembling: #ifdef __cplusplus extern "C" { #endif void *memset (void *, int, size_t); char *strcat (char *, const char *); int strcmp (const char *, const char *); char *strcpy (char *, const char *); #ifdef __cplusplus } #endif Thus, code such as: if (strcmp(argv[1], "-x") == 0) strcpy(a, argv[2]); else memset (a, 0, sizeof(a)); uses the correct, unmangled and . If the had not been used, the (SunPro) C++ compiler would produce code equivalent to: if (__1cGstrcmp6Fpkc1_i_(argv[1], "-x") == 0) __1cGstrcpy6Fpcpkc_0_(a, argv[2]); else __1cGmemset6FpviI_0_ (a, 0, sizeof(a)); Since those symbols do not exist in the C runtime library (e.g. libc), link errors would result. Standardized name mangling in C++ It would seem that standardized name mangling in the C++ language would lead to greater interoperability between compiler implementations. However, such a standardization by itself would not suffice to guarantee C++ compiler interoperability and