#pragma nameManglingRule

C++ only


The #pragma nameManglingRule directive instructs the compiler whether or not to mangle function names according to their function parameter types.


Read syntax diagramSkip visual syntax diagram>>-#--pragma--nameManglingRule--(--fnparmtype--,--+-on--+--)---><


on Function arguments are mangled according to function parameter types. For example, cv qualifiers in function arguments are not mangled.
off Name mangling is compatible with VisualAge C++ version 5.0, and cv qualifiers in function arguments are mangled.
pop Discards the current #pragma nameManglingRule setting, and replaces it with the previous #pragma nameManglingRule setting from the stack. If no previous settings remain on the stack, the default #pragma nameManglingRule setting is used.


The default is #pragma nameManglingRule(fnparmtype, on) when the -qnamemangling=ansi or #pragma namemangling(ansi) compiler options are in effect.

For all other settings of -qnamemangling or #pragma namemangling, the default is #pragma nameManglingRule(fnparmtype, off).


This directive provides name mangling scheme compatibility between the current level of the XL C++ compiler and previous versions.

#pragma nameManglingRule has no effect on a block scope function declaration with external linkage. It is allowed in global, class, and function scopes. Different pragma settings can be specified in front of function declarations and definitions. If #pragma nameManglingRule settings in subsequent declarations and definitions conflict, the compiler ignores those settings and issues a warning message.

A given #pragma nameManglingRule setting remains in effect until overridden by another #pragma nameManglingRule setting.

Each new #pragma nameManglingRule setting is pushed onto a stack, over top of the previously-specified setting. The setting currently in effect can be removed from the top of the stack with the pop suboption. It is replaced by the previous setting stored in the stack, if any remain. If no settings remain, the default #pragma nameManglingRule setting is used.

Related information