Author Topic: "Instantiated from" seen as error  (Read 8631 times)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
"Instantiated from" seen as error
« on: June 02, 2007, 02:17:34 am »
Code
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?

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: "Instantiated from" seen as error
« Reply #1 on: June 02, 2007, 02:28:16 am »
OK I think i found it.

In compilerMinGW, line 183:

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

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: "Instantiated from" seen as error
« Reply #2 on: June 02, 2007, 02:48:15 am »
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".
« Last Edit: June 02, 2007, 03:00:56 am by rickg22 »

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: "Instantiated from" seen as error
« Reply #3 on: June 02, 2007, 03:07:31 am »
It works! :)

This is the result.

Code
:: === 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.