Compiler (warning C4786:)

T

thule

Okay, thanks to John (THANK YOU SO MUCH). I switched all my header files
over to using the new Standard <iostream> and included the using namespace
std; . This seems to have fixed all the errors I was getting because of
mixing the old and new headers. The problem I am running into now is not an
error but 10 warnings when compiling the same class header implimentation
file that I was working with when I was having the problems with the map
class(or so I thought). I get 10 warnings of type C4786. I looked up the
warning and got this.

---------------------------------------------------------------------------
--
Compiler Warning (level 1) C4786
'identifier' : identifier was truncated to 'number' characters in the debug
information

The identifier string exceeded the maximum allowable length and was
truncated.

The debugger cannot debug code with symbols longer than 255 characters. In
the debugger, you cannot view, evaluate, update, or watch the truncated
symbols.

----------------------------------------------------------------------------
---------------

The warning is pointing here in the implimentation file (only the beginning
snippet not the full file for sake of space)
(<--*) Points to line indicated by debugger

----------------------------------------------------------------------------
---------------
// SkillList.cpp: implementation of the SkillList class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "SkillList.h"


/////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

SkillList::SkillList()
{

} (<--*)

SkillList::~SkillList()
{

}
//////////////////////////////////////////////////////////////////////
// Overloaded Operators
//////////////////////////////////////////////////////////////////////

ostream& operator<< (ostream& os, const Skill& skill)
{
os << skill.GetName() << ":\t" << skill.GetSLevel() << endl;
return os;
}
----------------------------------------------------------------------------
--------------


I can't seem to figure out why this warning is getting sent to an end brace.
The Class member function seems to be declared right and there are no other
identifiers afterwards which the debugger could be misreading. I think there
must be something being read wrong earlier as I have no identifiers nearly
as large as the max of 255. The other strange thing is that not all of the
warnings are for my code but a few point to code in a "xtree" and "utility"
file which I assume to be part of a standard header I am using. I'll list a
full warning of each type.. one that points to my code and one that points
to code in a "xtree" file.

-Warning pointing to the line indicated in implimantion file-

C:\Program Files\Microsoft Visual
Studio\MyProjects\GameProject\SkillList.cpp(16) : warning C4786:
'std::reverse_bidirectional_iterator<std::_Tree<int,std::pair<int const
::_Kfn,std::l
ess<int>,std::allocator<Skill> >::iterator,std::pair<int const
,Skill>,std::pair<int const ,Skill> &,std::pair<int const ,Skill> *,int>' :
identifier was truncated to '255' characters in the debug information

-Warning pointing to a line indicated in a "xtree" file-

c:\program files\microsoft visual studio\vc98\include\xtree(174) : warning
C4786: 'std::_Tree<int,std::pair<int const
::_Kfn,std::less<int>,std::allocator<Skill> >::_Tree<int,std::pair
::_Kfn,std::less<int>,std::allocator<Skill> >' : identifier was truncated
to '255' characters in the debug information


Any help at all would again be most appreciated. Thank you for your patience
with this confused youngster.

Jason

ps I've included below the interface header file which is included in the
implimentation file in the off chance that the problem may be found there;

----------------------------------------------------------------------------
---------------------------------
// SkillList.h: interface for the SkillList class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SKILLLIST_H)
#define AFX_SKILLLIST_H

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000



#include "Skill.h"
#include "String.h"

using namespace std;

// Map SkillMap defined to contain an int key and a Skill as its data
typedef map<int, Skill> SkillMap;

class SkillList
{
public:

SkillList();
virtual ~SkillList();

SkillMap GetList() const;
void SetSkillnList( Skill );
void ShowList() const;

friend ostream& operator<< (ostream& os, Skill& skill);

protected:
SkillMap itsSkillMap;

};

#endif // !defined(AFX_SKILLLIST_H)
 
S

Sharad Kala

thule said:
Okay, thanks to John (THANK YOU SO MUCH). I switched all my header files
over to using the new Standard <iostream> and included the using namespace
std; . This seems to have fixed all the errors I was getting because of
mixing the old and new headers. The problem I am running into now is not an
error but 10 warnings when compiling the same class header implimentation
file that I was working with when I was having the problems with the map
class(or so I thought). I get 10 warnings of type C4786. I looked up the
warning and got this.

---------------------------------------------------------------------------

Read this -
http://www.codeguru.com/forum/showthread.php?s=&threadid=232164

-Sharad
 
L

Leor Zolman

Okay, thanks to John (THANK YOU SO MUCH). I switched all my header files
over to using the new Standard <iostream> and included the using namespace
std; . This seems to have fixed all the errors I was getting because of
mixing the old and new headers. The problem I am running into now is not an
error but 10 warnings when compiling the same class header implimentation
file that I was working with when I was having the problems with the map
class(or so I thought). I get 10 warnings of type C4786. I looked up the
warning and got this.

---------------------------------------------------------------------------

How many readers of this group have been laying odds I'd be the one to
respond to this? :)

C4786 warnings are a long-standing VC6 problem, because they seldom
contribute useful information. There's just some internal symbol length
warning that gets triggered by expanded template type names. There's a
pragma that's supposed to work to turn them off, but there are some
ordering issues and I'm not sure I've yet seen a 100%-sure fire way to deal
with them from the compiler angle.

So consider using STLFilt, which makes them all go away automatically
(along with the trailing fragmentary messages that often follow them, or
what I refer to as their "detritus")
-leor
 
S

Sharad Kala

Well what do you know, another C++ FAQ! There's some good stuff in there, I
much prefer the style to our existing FAQ, and frankly the questions seem to
be much more frequently asked than some of the obscure topics in the
official FAQ.

Yes, the FAQ is more like day to day problems which people face.
Could do with some organising however, and I spotted the odd inaccuracy, but
I'll remember it for future use.

:)

-Sharad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top