I have this method in library:
#include <stdexcept>
mytype* myfunc()
{
throw std::runtime_error("is uncatchable");
}
and this in int main()
of executable process which links library.
try { myfunc(); }
catch(std::exception const& ex) { std::cout << "handled: " << ex.what() << std::endl; }
catch(...) { std::cout << "something else..." << std::endl; }
And that is the output:
terminate called after throwing an instance of 'std::runtime_error'
what(): is uncatchable
Abort (core dumped)
Question: Why exception was not catch?
I'm not managing my compiler's flags (icc-11.X), also OS is also not under my control.
List of compiler flags:
-DLINUX -DLINUX_X64 -DGNU_SOURCE -fPIC -Wcheck -Wshadow -Wdeprecated -Wreturn-type -Wcomment -Wmissing-prototypes -Wp64 -Drcsid="__attribute__((used)) rcsid"
-D__EXTENSIONS__ -D__STD_C__ -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -DNDEBUG
__EXCEPTIONS
is defined.
May there exist settings for Linux which lead to this?
May there exist settings for compiler which lead to this?