News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

"Instantiated from" seen as error

Started by rickg22, June 02, 2007, 02:17:34 AM

Previous topic - Next topic

rickg22

G:/MinGw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h: In member function `typename std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_Link_type std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_copy(const std::_Rb_tree_node<_Val>*, std::_Rb_tree_node<_Val>*) [with _Key = wxString, _Val = std::pair<const wxString, wxArrayString>, _KeyOfValue = std::_Select1st<std::pair<const wxString, wxArrayString> >, _Compare = std::less<wxString>, _Alloc = std::allocator<std::pair<const wxString, wxArrayString> >]':
G:/MinGw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:768:   instantiated from `std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::operator=(const std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&) [with _Key = wxString, _Val = std::pair<const wxString, wxArrayString>, _KeyOfValue = std::_Select1st<std::pair<const wxString, wxArrayString> >, _Compare = std::less<wxString>, _Alloc = std::allocator<std::pair<const wxString, wxArrayString> >]'
G:/MinGw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_map.h:218:   instantiated from `std::map<_Key, _Tp, _Compare, _Alloc>& std::map<_Key, _Tp, _Compare, _Alloc>::operator=(const std::map<_Key, _Tp, _Compare, _Alloc>&) [with _Key = wxString, _Tp = wxArrayString, _Compare = std::less<wxString>, _Alloc = std::allocator<std::pair<const wxString, wxArrayString> >]'
include/scripting/sqplus/sqplus.h:502:   instantiated from `int SqPlus::CreateCopyInstance(const SQChar*, const T&) [with T = cbProject]'
include/scripting/bindings/sc_base_types.h:36:   instantiated from here
G:/MinGw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:1029: warning: '__top' might be used uninitialized in this function
G:/MinGw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_tree.h:365: warning: '__tmp' might be used uninitialized in this function


When compiling CB, I got these infos treated as errors. How come?

rickg22

OK I think i found it.

In compilerMinGW, line 183:


m_RegExes.Add(RegExStruct(_("'Instantiated from here' info"), cltNormal, _T("(") + FilePathWithSpaces + _T("):([0-9]+):[ \t]+([iI]nstantiated from here.*)"), 3, 1, 2));    m_RegExes.Add(RegExStruct(_("Resource compiler error"), cltError, _T("windres.exe:[ \t](") + FilePathWithSpaces + _T("):([0-9]+):[ \t](.*)"), 3, 1, 2));


"Instantiated from here.*"  should be replaced with "instantiated from ".
I'm going to change it.

rickg22

#2
Alright! It doesn't show them as errors anymore. Now the question is how to add them to the build messages. This "instantiated from" info is too important when dealing with STL errors and warnings. Since adding an "important info" flag would be too risky, I'm just modifying the type of message to "warning".

rickg22

It works! :)

This is the result.


:: === Code::Blocks, sdk ===
G:\MinGw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\bits\stl_tree.h:768: instantiated from `std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>& std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::operator=(const std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>&) [with _Key = wxString, _Val = std::pair<const wxString, wxArrayString>, _KeyOfValue = std::_Select1st<std::pair<const wxString, wxArrayString> >, _Compare = std::less<wxString>, _Alloc = std::allocator<std::pair<const wxString, wxArrayString> >]'
G:\MinGw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\bits\stl_map.h:218: instantiated from `std::map<_Key, _Tp, _Compare, _Alloc>& std::map<_Key, _Tp, _Compare, _Alloc>::operator=(const std::map<_Key, _Tp, _Compare, _Alloc>&) [with _Key = wxString, _Tp = wxArrayString, _Compare = std::less<wxString>, _Alloc = std::allocator<std::pair<const wxString, wxArrayString> >]'
include\scripting\sqplus\sqplus.h:502: instantiated from `int SqPlus::CreateCopyInstance(const SQChar*, const T&) [with T = cbProject]'
include\scripting\bindings\sc_base_types.h:36: instantiated from here
G:\MinGw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\bits\stl_tree.h:1029: warning: '__top' might be used uninitialized in this function
G:\MinGw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\c++\3.4.5\bits\stl_tree.h:365: warning: '__tmp' might be used uninitialized in this function
:: === Build finished: 0 errors, 6 warnings ===


Now we can trace the warning in a Template function to all its instantiations. :) I'll upload the patch tonight.