#pragma warning (disable : 4786)
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: #pragma warning (disable : 4786)

  1. #1
    Join Date
    Aug 1999
    Location
    Switzerland - Aargau
    Posts
    83

    #pragma warning (disable : 4786)

    I use list and set templates in my SDI MFC APP. well, I have no problems with them, but always when I rebuild the whole project I get 40 warnings!

    I tried to disable them by using:
    #pragma warning (disable : 4786)

    but I still get some warnings. question: where exactly do I have to place this? in *.cpp or *.h files? do I have to care about a special position to place it? is my pragma wrong?

    example of a warning:
    c:\program files\microsoft visual studio\vc98\include\xtree(160) : warning C4786: 'std::_Tree<CScene3DS *,CScene3DS *,std::set<CScene3DS *,std::less<CScene3DS *>,std::allocator<CScene3DS *> >::_Kfn,std::less<CScene3DS *>,std::allocator<CScene3DS *>
    >::_Tree<CScene3DS *,CScene3DS *,std::set<CScene3DS *,std::less<CScene3DS *>,std::allocator<CScene3DS *> >::_Kfn,std::less<CScene3DS *>,std::allocator<CScene3DS *> >' : identifier was truncated to '255' characters in the debug information

    thanks a lot in advance!
    Yannick


  2. #2
    Join Date
    Jun 2001
    Location
    Switzerland
    Posts
    4,443

    Re: #pragma warning (disable : 4786)

    BUG: C4786 Warning Is Not Disabled with #pragma Warning

    Q167355


    --------------------------------------------------------------------------------
    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<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.



    MORE INFORMATION
    This warning can be ignored. However, the identifier may not be accessible or viewable in the debugger.



    Gabriel.
    _
    Forever trusting who we are
    And nothing else matters
    - Metallica
    _
    Gabriel, CodeGuru moderator

    Forever trusting who we are
    And nothing else matters
    - Metallica

    Learn about the advantages of std::vector.

  3. #3
    Join Date
    May 2001
    Location
    Madrid-Spain
    Posts
    1,123

    Re: #pragma warning (disable : 4786)

    Write it in StdAfx.h, before all includes... and if you have still the warnings, look at the post of Gabriel.

    I am Miss Maiden... Miss Iron Maiden :-D

  4. #4
    Join Date
    Aug 1999
    Location
    Switzerland - Aargau
    Posts
    83

    Re: #pragma warning (disable : 4786)

    ahh, thanks a lot!
    Y


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center