The following code occasionally fails with bad allocation exception or unknow exception when I compile it with /EHa flag in Release configuration. It does not fail when I build it in Debug configuration and in all configurations with MS Visual C++ Compiler.
using namespace std;
v.push_back( L'0' );
cout << "Ok" << endl;
catch( std::exception& e )
cout << "Failed with " << e.what() << endl;
I have run sample 20 times and 14 of them have fallen.
Intel(R) C++ Compiler XE, Version 184.108.40.2060 Build 20120130
OS: Windows 7 Professinal with SP1 x64
Compiler options: /c /O2 /Oi /Qipo /D "_MBCS" /EHa /MD /GS /Gy /fp:fast /Fo"Release/" /Fd"Release/vc90.pdb" /W3 /nologo /Zi
What am I doing wrong? Could you help me please?
The sample project is attached.