[conversion] lexical_cast doesn't throw

Hi all, I'm in the process to migrate our application from RedHat 5.5 (gcc 4.1.2) to Ubuntu 10.04 (gcc 4.4.3), one regression test is not passing due the fact that lexical_cast is not throwing, this is the line: unsigned int myNumber = boost::lexical_cast<unsigned int>("-123"); I'm using boost 1.40 on both servers. I have noticed that the same executable compiled on Ubuntu 10.04 while on Ubuntu doesn't throw, running it on RH 5.5 throws, so it seems a system library problem. Trying with a simple stringstream, it seems that with the following code: std::stringstream myStream; myStream << "-123"; unsigned int myUInt; myStream >> myUInt; doens't set the fail bit on Ubuntu 10.04, but it does on RedHat 5.5. Does anyone have an idea on what is going on Regards Gaetano Mendola
participants (1)
-
Gaetano Mendola