Ticket URL: <
http://trac.wxwidgets.org/ticket/14826>
#14826: Eliminate build warning #809 regarding exceptions in virtual destructors of
STL base classes, with MSVC 2012/11.0 + ICC 13.0.1
----------------------------------------------------------------------------------------------------------+
Reporter: ghostvoodooman | Owner:
Type: build error | Status: new
Priority: low | Milestone:
Component: build | Version: 2.9-svn
Keywords: ICC Intel compiler visual studio 2012 virtual destructor throw exception warning 809 STL std | Blockedby:
Patch: 1 | Blocking:
----------------------------------------------------------------------------------------------------------+
I hope this is not a dupe.
I have 2 warnings in program using headers from wx, and some warnings when
building the whole wx library from the latest trunk.
In both projects I am using ICC 13.0.1 and STL from MSVC 2012 / 11.0 . I
am compiling wxWidgets as DLL|Debug|x64 and DLL|Release|x64 and using
enabled C++0x mode.
Though I guess it has nothing to do with ICC, since ICC plug-in in
MSVC/devenv.exe IDE is using MSVC's STL.
my custom setup.h (only relevant settings):
wxUSE_STL defined to 0
wxUSE_STD_CONTAINERS defined to 1
wxUSE_STD_IOSTREAM defined to 1
wxUSE_STD_DEFAULT defined to 1
wxUSE_STD_STRING defined to wxUSE_STD_DEFAULT
wxUSE_STD_STRING_CONV_IN_WXSTRING defined to wxUSE_STL
SVN trunk r72949 .
my program using WX library:
{{{
c:\PATH_TO_wxWidgets\include\wx/textctrl.h(682): warning #809: exception
specification for virtual function "wxTextCtrlBase::~wxTextCtrlBase" is
incompatible with that of overridden function "std::basic_streambuf<_Elem,
_Traits>::~basic_streambuf [with _Elem=char,
_Traits=std::char_traits<char>]"
c:\PATH_TO_wxWidgets\include\wx/msw/textctrl.h(34): warning #809:
exception specification for virtual function "wxTextCtrl::~wxTextCtrl" is
incompatible with that of overridden function "std::basic_streambuf<_Elem,
_Traits>::~basic_streambuf [with _Elem=char,
_Traits=std::char_traits<char>]"
}}}
wx library itself (this is only sort'ed and uniq'ued list):
{{{
..\..\include\wx/msw/textctrl.h(34): warning #809: exception specification
for virtual function "wxTextCtrl::~wxTextCtrl" is incompatible with that
of overridden function "std::basic_streambuf<_Elem,
_Traits>::~basic_streambuf [with _Elem=char,
_Traits=std::char_traits<char>]"
..\..\include\wx/stdstream.h(115): warning #809: exception specification
for virtual function "wxStdOutputStream::~wxStdOutputStream" is
incompatible with that of overridden function "std::basic_ios<_Elem,
_Traits>::~basic_ios [with _Elem=char, _Traits=std::char_traits<char>]"
..\..\include\wx/stdstream.h(115): warning #809: exception specification
for virtual function "wxStdOutputStream::~wxStdOutputStream" is
incompatible with that of overridden function "std::basic_ostream<_Elem,
_Traits>::~basic_ostream [with _Elem=char,
_Traits=std::char_traits<char>]"
..\..\include\wx/stdstream.h(115): warning #809: exception specification
for virtual function "wxStdOutputStream::~wxStdOutputStream" is
incompatible with that of overridden function "std::ios_base::~ios_base"
..\..\include\wx/stdstream.h(31): warning #809: exception specification
for virtual function "wxStdInputStreamBuffer::~wxStdInputStreamBuffer" is
incompatible with that of overridden function "std::basic_streambuf<_Elem,
_Traits>::~basic_streambuf [with _Elem=char,
_Traits=std::char_traits<char>]"
..\..\include\wx/stdstream.h(74): warning #809: exception specification
for virtual function "wxStdInputStream::~wxStdInputStream" is incompatible
with that of overridden function "std::basic_ios<_Elem,
_Traits>::~basic_ios [with _Elem=char, _Traits=std::char_traits<char>]"
..\..\include\wx/stdstream.h(74): warning #809: exception specification
for virtual function "wxStdInputStream::~wxStdInputStream" is incompatible
with that of overridden function "std::basic_istream<_Elem,
_Traits>::~basic_istream [with _Elem=char,
_Traits=std::char_traits<char>]"
..\..\include\wx/stdstream.h(74): warning #809: exception specification
for virtual function "wxStdInputStream::~wxStdInputStream" is incompatible
with that of overridden function "std::ios_base::~ios_base"
..\..\include\wx/stdstream.h(88): warning #809: exception specification
for virtual function "wxStdOutputStreamBuffer::~wxStdOutputStreamBuffer"
is incompatible with that of overridden function
"std::basic_streambuf<_Elem, _Traits>::~basic_streambuf [with _Elem=char,
_Traits=std::char_traits<char>]"
..\..\include\wx/textctrl.h(682): warning #809: exception specification
for virtual function "wxTextCtrlBase::~wxTextCtrlBase" is incompatible
with that of overridden function "std::basic_streambuf<_Elem,
_Traits>::~basic_streambuf [with _Elem=char,
_Traits=std::char_traits<char>]"
..\..\src\common\combocmn.cpp(943): warning #809: exception specification
for virtual function "wxComboCtrlTextCtrl::~wxComboCtrlTextCtrl" is
incompatible with that of overridden function "std::basic_streambuf<_Elem,
_Traits>::~basic_streambuf [with _Elem=char,
_Traits=std::char_traits<char>]"
..\..\src\generic\spinctlg.cpp(80): warning #809: exception specification
for virtual function "wxSpinCtrlTextGeneric::~wxSpinCtrlTextGeneric" is
incompatible with that of overridden function "std::basic_streambuf<_Elem,
_Traits>::~basic_streambuf [with _Elem=char,
_Traits=std::char_traits<char>]"
}}}
My best guess is that these WX classes are derived from STL classes (e.g.
streams) which might throw an exception in their virtual destructor.
Attaching patch fixing those warnings against r72949 , but I'm not sure
about it, it might cause performance penalty (due to exceptions) in build
without using STD/STL by custom setup.h . I guess there should be
preprocessor guards/disablers around "throw()" in my patch for such case?
--
Ticket URL: <
http://trac.wxwidgets.org/ticket/14826>