How can I fix the warning C4786 'identifier' : identifier wastruncated to 'number' characters in the

Discussion in 'C++' started by babakandme@yahoo.com, Dec 11, 2007.

  1. Guest

    I have a MyIOManager Object.
    In this object I have a ""typedef map<_TCHAR, Command *> cmdMap""

    I also have a CommandManager & Command Objects.


    // MyIOManager class
    ....
    typedef map<_TCHAR, Command *> commandMap;
    ....
    class MyIOManager
    {
    ....
    commandMap cmdMap;
    CommandManager * cmdManager;
    Command * cmd
    ....
    }

    MyIOManager::StartIO()
    {
    ....
    cmd = cmdManager->CatchCommand( cmdMap );
    ....
    }

    // CommandManager class
    Command * CommandManager::CatchCommand( ... )
    {
    ....
    // return a Command *...
    }



    But I get too many warnings like the following:
    What is wrong?
    How can I fix it?

    I checked the MSDN Library... there is written that I should shorten
    the Identifier names..., But I don't understand, I don't have at all
    long name more than 255 characters...

    Thanks...



    d:\installingfolder\microsoft visual studio\vc98\include\xtree(200) :
    warning C4786: '?rbegin@?$_Tree@DU?$pair@$$CBDPCommand@@@std@@U_Kfn@?
    $map@DPCommand@@U?$less@D@std@@V?$allocator@PCommand@@@3@@2@U?
    $less@D@2@V?$allocator@PCommand@@@2@@std
    @@QAE?AV?$reverse_bidirectional_iterator@Viterator@?$_Tree@DU?$pair@$
    $CBDPCommand@@@std@@U_Kfn@?$map@DPCommand@@U?$less@D@std@@V?
    $allocator@PCommand@@@3@@2@U?$less@D@2@V?
    $allocator@PCommand@@@2@@std@@U?$pair@$$CBDPCommand@@@3@AAU43@PAU43@H
    @2@XZ' :


    identifier was truncated to '255' characters in the browser
    information



    d:\installingfolder\microsoft visual studio\vc98\include
    \map(46) : see reference to class template instantiation
    'std::_Tree<char,struct std::pair<char const ,class Command *>,struct
    std::map<char,class Command *,struct std::less<char>,class
    std::allocator<class Command *> >::_Kfn,struct std::less<char>,class
    std::allocator<class Command *> >' being compiled
    d:\documents\myprojects\commandmanager.h(31) : see reference
    to class template instantiation 'std::map<char,class Command *,struct
    std::less<char>,class std::allocator<class Command *> >' being compiled
     
    , Dec 11, 2007
    #1
    1. Advertising

  2. On Dec 11, 8:27 pm, wrote:
    > I have a MyIOManager Object.
    > In this object I have a ""typedef map<_TCHAR, Command *> cmdMap""
    >
    > I also have a CommandManager & Command Objects.
    >
    > // MyIOManager class
    > ...
    > typedef map<_TCHAR, Command *> commandMap;
    > ...
    > class MyIOManager
    > {
    > ...
    > commandMap cmdMap;
    > CommandManager * cmdManager;
    > Command * cmd
    > ...
    >
    > }
    >
    > MyIOManager::StartIO()
    > {
    > ...
    > cmd = cmdManager->CatchCommand( cmdMap );
    > ...
    >
    > }
    >
    > // CommandManager class
    > Command * CommandManager::CatchCommand( ... )
    > {
    > ...
    > // return a Command *...
    >
    > }
    >
    > But I get too many warnings like the following:
    > What is wrong?
    > How can I fix it?
    >
    > I checked the MSDN Library... there is written that I should shorten
    > the Identifier names..., But I don't understand, I don't have at all
    > long name more than 255 characters...
    >
    > Thanks...
    >
    > d:\installingfolder\microsoft visual studio\vc98\include\xtree(200) :
    > warning C4786: '?rbegin@?$_Tree@DU?$pair@$$CBDPCommand@@@std@@U_Kfn@?
    > $map@DPCommand@@U?$less@D@std@@V?$allocator@PCommand@@@3@@2@U?
    > $less@D@2@V?$allocator@PCommand@@@2@@std
    > @@QAE?AV?$reverse_bidirectional_iterator@Viterator@?$_Tree@DU?$pair@$
    > $CBDPCommand@@@std@@U_Kfn@?$map@DPCommand@@U?$less@D@std@@V?
    > $allocator@PCommand@@@3@@2@U?$less@D@2@V?
    > $allocator@PCommand@@@2@@std@@U?$pair@$$CBDPCommand@@@3@AAU43@PAU43@H
    > @2@XZ' :
    >
    > identifier was truncated to '255' characters in the browser
    > information
    >
    > d:\installingfolder\microsoft visual studio\vc98\include
    > \map(46) : see reference to class template instantiation
    > 'std::_Tree<char,struct std::pair<char const ,class Command *>,struct
    > std::map<char,class Command *,struct std::less<char>,class
    > std::allocator<class Command *> >::_Kfn,struct std::less<char>,class
    > std::allocator<class Command *> >' being compiled
    > d:\documents\myprojects\commandmanager.h(31) : see reference
    > to class template instantiation 'std::map<char,class Command *,struct
    > std::less<char>,class std::allocator<class Command *> >' being compiled


    You would probably only get this warning in the debug builds. You can
    (almost) safely suppress this warning using the following pragma
    directive:

    #pragma warning(disable: 4786)
     
    Abhishek Padmanabh, Dec 11, 2007
    #2
    1. Advertising

  3. On Dec 11, 7:27 am, wrote:
    > I have a MyIOManager Object.
    > In this object I have a ""typedef map<_TCHAR, Command *> cmdMap""
    >
    > I also have a CommandManager & Command Objects.
    >
    > // MyIOManager class
    > ...
    > typedef map<_TCHAR, Command *> commandMap;
    > ...
    > class MyIOManager
    > {
    > ...
    > commandMap cmdMap;
    > CommandManager * cmdManager;
    > Command * cmd
    > ...
    >
    > }
    >
    > MyIOManager::StartIO()
    > {
    > ...
    > cmd = cmdManager->CatchCommand( cmdMap );
    > ...
    >
    > }
    >
    > // CommandManager class
    > Command * CommandManager::CatchCommand( ... )
    > {
    > ...
    > // return a Command *...
    >
    > }
    >
    > But I get too many warnings like the following:
    > What is wrong?
    > How can I fix it?
    >
    > I checked the MSDN Library... there is written that I should shorten
    > the Identifier names..., But I don't understand, I don't have at all
    > long name more than 255 characters...
    >
    > Thanks...
    >
    > d:\installingfolder\microsoft visual studio\vc98\include\xtree(200) :
    > warning C4786: '?rbegin@?$_Tree@DU?$pair@$$CBDPCommand@@@std@@U_Kfn@?
    > $map@DPCommand@@U?$less@D@std@@V?$allocator@PCommand@@@3@@2@U?
    > $less@D@2@V?$allocator@PCommand@@@2@@std
    > @@QAE?AV?$reverse_bidirectional_iterator@Viterator@?$_Tree@DU?$pair@$
    > $CBDPCommand@@@std@@U_Kfn@?$map@DPCommand@@U?$less@D@std@@V?
    > $allocator@PCommand@@@3@@2@U?$less@D@2@V?
    > $allocator@PCommand@@@2@@std@@U?$pair@$$CBDPCommand@@@3@AAU43@PAU43@H
    > @2@XZ' :
    >
    > identifier was truncated to '255' characters in the browser
    > information
    >
    > d:\installingfolder\microsoft visual studio\vc98\include
    > \map(46) : see reference to class template instantiation
    > 'std::_Tree<char,struct std::pair<char const ,class Command *>,struct
    > std::map<char,class Command *,struct std::less<char>,class
    > std::allocator<class Command *> >::_Kfn,struct std::less<char>,class
    > std::allocator<class Command *> >' being compiled
    > d:\documents\myprojects\commandmanager.h(31) : see reference
    > to class template instantiation 'std::map<char,class Command *,struct
    > std::less<char>,class std::allocator<class Command *> >' being compiled


    Upgrade to a modern compiler. VC6 is almost ten years old and was
    written before the current C++ standard. Later versions of the same
    compiler have no problem with the symbols generated by template
    expansion.
     
    Owen Jacobson, Dec 11, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Xah Lee
    Replies:
    22
    Views:
    1,172
    Tim Roberts
    Mar 21, 2006
  2. thule

    Compiler (warning C4786:)

    thule, Apr 1, 2004, in forum: C++
    Replies:
    4
    Views:
    4,329
    Sharad Kala
    Apr 2, 2004
  3. Jason Heyes
    Replies:
    5
    Views:
    22,101
    David Harmon
    Mar 4, 2005
  4. Xah Lee
    Replies:
    23
    Views:
    1,120
    Tim Roberts
    Mar 21, 2006
  5. Xah Lee
    Replies:
    21
    Views:
    842
    Tim Roberts
    Mar 21, 2006
Loading...

Share This Page