Does anybody know how to stop the C4786 warning (symbol > 255 chars) when
defining a map?
I have the following test code;
#include <map>
#include <string>
class myClass
{
...
}
int main()
{
std::map< std::string , myClass* > myMap;
...
}
and it produces about 24 warnings. There is a bug which stops the #pragma
warning(disable:4786)
from working and I've tried typedef's and #defines to no avail. In my actual
code I'm getting > 1000
warnings which makes finding the errors a nightmare.
Any help gratefully appreciated
Thanks
Tony
Example:
#pragma warning(disable: 4786)
#include <map>
#include <string>
"Anthony Hill" <Mrantho...@btopenworld.com> wrote in message
news:a45pbi$2bg$1...@knossos.btinternet.com...
"Foo" <maiso...@home.com> wrote in message
news:P6u98.36172$X64.12...@news1.rdc2.pa.home.com...
-Kevin
BUG: C4786 Warning is Not Disabled with #pragma Warning
Last reviewed: April 24, 1997
Article ID: Q167355
The information in this article applies to:
Microsoft Visual C++, 32-bit Editions, version 5.0
SYMPTOMS
Warnings similar to the following are generated even if you use the warning
pragma to disable the warning:
warning C4786:
'std::rb_tree<CAiSpanningTree<State,std::less<State>>::TransClosureNode,
CAiSpanningTree<State,std::less<State>>::TransClosureNode,std::ident<Cai
SpanningTree<State,std::less<State>>::TransClosureNode,CAiSpanningTree<S
tate,std::less<State>>::TransClosureNode>,std::less<CAiSpanningTree<Stat
e,std::less<State>>::TransClosureNode>>' : identifier was truncated to
'255' characters in the debug information
The code:
#pragma warning(disable:4786)
disables warnings that list the file and line number. For example:
C:\test\Text.cpp(25) : warning C4786:
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at
the beginning of this article. We are researching this bug and will post new
information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATION
This warning can be ignored. However, the identifier may not be accessible
or viewable in the debugger.
"Kevin Goodsell" <good...@bridgernet.com> wrote in message
news:5vfd6ucaicup4hinh...@4ax.com...
"Anthony Hill" <Mrantho...@btopenworld.com> wrote in message
news:a46q1l$ovr$1...@paris.btinternet.com...
Whenever I have a C4786 warning pop up, I insert the #pragma at the
very top of the file, so it's before all #includes. This is because it
doesn't only apply to map<>, but can crop up with many of the STL
container classes.
-Kevin
On Sun, 10 Feb 2002 21:56:42 +0000 (UTC), "Anthony Hill"