The following code on line 841 of c_regex_traits.cpp in the regex library caused a crash when I used it in CodeWarrior 8.1 under OSX:
std::string l(std::setlocale(LC_CTYPE, 0));
Afaict the crash was caused by setlocale() returning 0. To fix this I had to resort to the following ugly hack:
namespace std { const char* mysetlocale(int, const char*) { return "C"; } }; #include "boost/regex.hpp" #define setlocale mysetlocale #include "boost/regex/src.cpp"
The C locale was used because I had BOOST_REGEX_USE_C_LOCALE defined. I didn't want to use the C++ locale since it doesn't even provide the basic 0x00-0xFF unicode case mapping that's built into the C locale (due to limited locale support in CW I guess). I'm using the wregex class.
Yikes, OK thanks for the report, I'll get a fix checked in. John Maddock http://ourworld.compuserve.com/homepages/john_maddock/index.htm