Coping With Warning Messages Regarding Identifier’s Length

Coping With Warning Messages Regarding Identifier’s Length

Unlike C, C++ does not impose any restrictions on the length of identifiers. Implementations set their own limits, but these are so high that identifiers can consist of tens of thousands of characters. Although you wouldn’t normally use more than a dozen characters as an identifier’s name, remember that during the name-mangling process, the compiler adds additional characters to the mangled name. When using templates, the resultant mangled names can be very large, because they incorporate even more information. Thus, on Visual C++, a typical mangled name of the following cii iterator:

 std::vector::const_iterator cii;

can exceed 255 characters. The mangled name of csi:


is twice as large. Some tools, such as the Visual C++ Debugger, cannot handle such long names and issue warning messages. You can safely ignore these messages because they are only related to the debugger’s ability to display extremely large names. However, the compiler and the linker should have no problem coping with extremely large identifiers.


Share the Post: