Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Turning off stupid warnings

Status
Not open for further replies.

timmay3141

Programmer
Dec 3, 2002
468
US
I'm getting a stupid warning from MSVC++ 6.0. I don't even know what this means:

c:\program files\microsoft visual studio\vc98\include\vector(39) : warning C4786: 'std::reverse_iterator<std::vector<CUSTOMVERTEX,std::allocator<CUSTOMVERTEX> > const *,std::vector<CUSTOMVERTEX,std::allocator<CUSTOMVERTEX> >,std::vector<CUSTOMVERTEX
,std::allocator<CUSTOMVERTEX> > const &,std::vector<CUSTOMVERTEX,std::allocator<CUSTOMVERTEX> > const *,int>' : identifier was truncated to '255' characters in the debug information
c:\program files\microsoft visual studio\vc98\include\vector(39) : while compiling class-template member function '__thiscall std::vector<std::vector<CUSTOMVERTEX,std::allocator<CUSTOMVERTEX> >,std::allocator<std::vector<CUSTOMVERTEX,std::al
locator<CUSTOMVERTEX> > > >::std::vector<std::vector<CUSTOMVERTEX,std::allocator<CUSTOMVERTEX> >,std::allocator<std::vector<CUSTOMVERTEX,std::allocator<CUSTOMVERTEX> > > >(const std::allocator<std::vector<CUSTOMVERTEX,std::allocator<CUSTOMVERTEX> >
> &)'

I guess it's referring to my vector of vectors (it's for a 2D array). The warning doesn't seem to be important or even make any sense, but apparently Microsoft thinks it knows more than me and when I tell it to ignore this warning by adding the line #pragma warning(disable:4786) it gives me the warning anyway. What can I do to fix this?
 
Try to place the #pragma before any includes.
This warning raised in debug mode only (when debug info generated). It's true: mangled names from templates was truncated...
I think, the best policy is never disable any warnings. One morning (evening, night) this rule may save your life (or career;)...
 
Some elaboration: place
Code:
#pragma warning(disable:4786)
in StdAfx.h (if you have it) before any includes. In the most outer context, in a word. And don't forget to recompile stdafx.cpp (pre-compiled headers carrier).
 
Search in help C4786. You will see an option to put in compillers parameters. Put this option and rebuild the project.

Ion Filipski
1c.bmp
 
I agree with ArkM that you should not disable warnings permanantly... however, you could do it for a specified area. Look in MSDN for #pragma warning(push) and (pop). With this, you can disable it where you want to and have it and vice versa.

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top