Boost logo

Boost Users :

Subject: [Boost-users] [lexical_cast] crash using Intel 12.0 with optimizations enabled
From: Thomas Mang (thomasmang.ng_at_[hidden])
Date: 2011-03-17 07:14:03


Hi,

I tracked down a crash to a call to boost::lexical_cast (Boost 1.46.1(
when using the Intel 12.0 compiler for Windows (embedded into MSVC8) if
optimizations are enabled.

I would have expected the mini-program below to work smoothly, but
instead the second catch-handler is entered (unknown exception).
The offending compiler option is /O; in all cases except of /Od [all
optimizations disabled] the exception is raised.

May I strongly suppose this is either a boost or an Intel compiler
issue, or did I misunderstand something ?

Below are full command-line compiler options and teh program.

Thanks and best,
Thomas

command line options:

/c /O2 /Og /Qipo /I "C:\Libraries\Boost\boost_1_46_1" /D "WIN32" /D
"NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /EHsc /MD /GS-
/fp:strict /Za /Fo"ReleaseFinal/" /W3 /nologo /Wp64 /Zi
/Qfp-speculation:strict /Quse-intel-optimized-headers /Qintel-extensions-

mini-program:

#include <iostream>
#include <ostream>
#include <string>

#include "boost/lexical_cast.hpp"

int main()
{
try
{
std::string X = boost::lexical_cast<std::string>(2 - 1);
std::cout << X << std::endl;
}
catch (boost::bad_lexical_cast const &)
{
std::cout << "boost::lexical_cast exception occurred.";
}
catch (...)
{
std::cout << "An unknown exception occurred.";
}
}


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net