
If I compile the following code (test.cc):
#include <iostream>
#include <string>
#include "boost/lexical_cast.hpp"
int main() {
int i;
std::string s("3");
try {
i = boost::lexical_cast<int>(s);
} catch (boost::bad_lexical_cast& e) {
std::cerr << "Error in conversion\n";
}
}
with the "-fast" and "-mcpu=G4" options for gcc 3.3 on MacOS X 10.4.5, like so:
g++ -I. -ggdb -fast -mcpu=G4 test.cc -o test
I get a Bus error when I run the compiled program. I do not get this
error when I omit the "-fast -mcpu=G4" options. Here is the trace
from gdb:
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x00017d44 in std::locale::operator= () at test.cc:11
11 }
(gdb) backtrace
#0 0x00017d44 in std::locale::operator= () at test.cc:11
#1 0x00019e54 in std::ios_base::_M_init () at test.cc:11
#2 0x0001a8c0 in std::basic_ios