Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

STL in VC++ 5.0 and warning C4786

Posted on 1998-07-06
5
Medium Priority
?
262 Views
Last Modified: 2010-08-05
I am using STL and MS Visual Developper Studio. I get tons of such Warnings:
'std::_Tree<std::basic_string<char,std::char_traits<char>,std::allocator<char>>,std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char>>,enum CVolInstr::Typ>,std::map<std:
:basic_string<char,std::char_traits<char>,std::allocator<char>>,enum CVolInstr::Typ,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>,std::allocator<enum CVolInstr::Typ>>::_Kfn,std::less<std::basic_string<char,std::char_
traits<char>,std::allocator<char>>>,std::allocator<enum CVolInstr::Typ>>::iterator' : identifier was truncated to '255' characters in the debug information

They are rather annoying, since one hardly finds the errors among tons of such warnings. Apart from that, i wonder why they appear at all. Can I enlarge the debuggers symbol table, so it will be happy with these long names. Or can a switch the warning off somhow? Or can i tell the Compiler to genrate shorter Symbolnames?

How can i get rid of those warnings?
0
Comment
Question by:Adelmo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 300 total points
ID: 1167247
answer coming.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1167248
You can use a pre-processor #pragma directive, like

#pragma warning(disable: XXXX)

where XXXX is the number of the warning you want to get rid of.  (I believe the warning you want to get rid of is C4786, if so, you would just type the 4786).  The warning number will display at the start of the warning message so you can find it there.

You need to place this directive before the STL header is included.

Now for the bad news.  This pragma does not always work, probably due to a bug or design flaw in VC.  This error is one in particular that it doesn't always work with.  (I have this problem a lot and sometimes cases the pragma works and in some cases it is ignored.)  You'll just have to try and see if it works.
0
 

Author Comment

by:Adelmo
ID: 1167249
I put this pragma in front of all headers, where som STL code is inlcuded and it worked for me.

Tnx

0
 
LVL 22

Expert Comment

by:nietod
ID: 1167250
Good.  You may find cases where it doesn't.  It seems random, but it seems stable, that is if it prints at a particular piece fo code, it always will, and nothing will change that.
0
 

Author Comment

by:Adelmo
ID: 1167251
Thanks, I'll try to remember that.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question