DOCUMENT:Q167355 10-FEB-2002 [visualc] TITLE :FIX: C4786 Warning Is Not Disabled with #pragma Warning PRODUCT :Microsoft C Compiler PROD/VER::5.0,6.0 OPER/SYS: KEYWORDS:kbcode kbtool kbCompiler kbVC500bug kbVC600bug kbNoUpdatekbbuglist ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual C++, 32-bit Enterprise Edition, versions 5.0, 6.0 - Microsoft Visual C++, 32-bit Professional Edition, versions 5.0, 6.0 - Microsoft Visual C++, 32-bit Learning Edition, version 6.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>::TransClosureNode, CAiSpanningTree>::TransClosureNode,std::ident>::TransClosureNode,CAiSpanningTree>::TransClosureNode>,std::less>::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. This problem was corrected in Microsoft Visual C++ .NET. MORE INFORMATION ================ This warning can be ignored. However, the identifier may not be accessible or viewable in the debugger. Sample Code ----------- /* Compiler Options: /Zi */ #include #include #pragma warning(disable:4786) namespace std { template struct ident {}; template struct pair {}; template struct binary_function {}; template struct less : binary_function {}; template struct bidirectional_iterator {}; template class rb_tree { public: typedef int size_type; typedef int difference_type; typedef void* link_type; struct rb_tree_node {}; typedef Key key_type; class iterator : public bidirectional_iterator {}; class const_iterator : public bidirectional_iterator { protected: link_type node; const_iterator(link_type x) : node(x) {} }; public: size_type count(const key_type& x) const; }; template rb_tree::size_type rb_tree:: count(const Key& k) const { size_type n = 0; return n; }; template class set { typedef ::std::rb_tree, Compare> rep_type; rep_type t; }; } template class CAiTransitiveClosure{ public: typedef std::set NodeSet; NodeSet m_todo; }; template class CAiSpanningTree { public: typedef std::set NodeSet; protected: typedef Node CAiSpanningTreeNode; typedef NodeSet CAiSpanningTreeNodeSet; private: struct TransClosureNode {}; struct TransClosureGraph : public CAiTransitiveClosure > {}; public: CAiSpanningTree(const Node& initialNode); CAiSpanningTree(const NodeSet& initialNodes); }; struct State { }; class CformSpanningTree:public CAiSpanningTree> { public: CFormSpanningTree( NodeSet initial) : CAiSpanningTree >(initial) {} }; Additional query words: ====================================================================== Keywords : kbcode kbtool kbCompiler kbVC500bug kbVC600bug kbNoUpdate kbbuglist Technology : kbVCsearch kbAudDeveloper kbVC500 kbVC600 kbVC32bitSearch kbVC500Search Version : :5.0,6.0 Issue type : kbbug Solution Type : kbfix ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 2002.