Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: C++
Expertise: All
Oct 5, 1999

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<int>::const_iterator cii;
can exceed 255 characters. The mangled name of csi:
 
std::vector<std::string>::const_iterator 
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.
Danny Kalev
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap