#pragma namemangling

C++ only

Description

The #pragma namemangling directive sets the name mangling scheme and the maximum length of external symbol names generated from C++ source code.

Syntax

Read syntax diagramSkip visual syntax diagram                               .-ansi---.
>>-#--pragma--namemangling--(--+-compat-+--+--------------+--)-><
                               +-v6-----+  '-,--num_chars-'
                               +-v5-----+
                               +-v4-----+
                               '-v3-----'

where:

ansi The name mangling scheme fully supports the various language features of Standard C++, including function template overloading. If you specify ansi but do not specify a size with num_chars, the default maximum is 64000 characters.
v6 The name mangling scheme is compatible with VisualAge C++ version 6.0. If you specify v6 but do not specify a size with num_chars, the default maximum is 64000 characters.
v5 The name mangling scheme is compatible with VisualAge C++ version 5.0. If you specify v5 but do not specify a size with num_chars, the default maximum is 64000 characters.
v4 The name mangling scheme is compatible with VisualAge C++ version 4.0. If you specify v4 but do not specify a size with num_chars, the default maximum is 64000 characters.
v3 The name mangling scheme is compatible with versions of VisualAge C++ earlier than version 4.0. If you specify v3 but do not specify a size with num_chars, the default maximum is 255 characters. Use this scheme for compatibility with link modules created with versions of XL C++ released prior to version 4.0, or with link modules that were created with the #pragma namemangling or -qnamemangling=compat compiler options specified.
compat Same as the v3 suboption, described above.

Notes

See -qnamemangling for information regarding changes to the ansi name mangling scheme.

You can use the #pragma namemangling directive to protect your header files from changes in namemangling schemes. For example, to always ensure that a given header file uses the v5 namemangling scheme, insert #pragma namemangling(v5)at the top of your header file, and append #pragma namemangling(pop) at the bottom of the file.

Related information