
I recently made the switch from visual studio 2005 to visual studio 2008. I have a project that uses boost regular expressions as shown in the following fragment: bool StringCompDesc::is_valid_input(char const *s) { bool rtn = strlen(s) <= max_len; if(rtn && validate_pattern.length()) { boost::regex ex(validate_pattern.c_str()); boost::cmatch what; rtn = boost::regex_match(s,what,ex); } return rtn; } // is_valid_input When this method is invoked with a value of "192.168.4.230" and a validate_pattern value of "^([0-9]{1,3})?(\.[0-9]{1,3}){0,3}$" under the release build, the program crashes. The stack trace shows that match_results<>::set_size() winds up invoking _invalid_parameter_noinfo(). I have seen this with both versions 1.33.1 and 1.34.1. It would appear that visual studio 2008 is not a recognised build environment for boost but, despite the warning messages emitted in the boost headers, it has appeared to work until now. If anyone is aware of a way to work around this problem, I would appreciate their advice. Regards, Jon Trauntvein

Jon Trauntvein wrote:
I recently made the switch from visual studio 2005 to visual studio 2008. I have a project that uses boost regular expressions as shown in the following fragment:
bool StringCompDesc::is_valid_input(char const *s) { bool rtn = strlen(s) <= max_len; if(rtn && validate_pattern.length()) { boost::regex ex(validate_pattern.c_str()); boost::cmatch what;
rtn = boost::regex_match(s,what,ex); } return rtn; } // is_valid_input
When this method is invoked with a value of "192.168.4.230" and a validate_pattern value of "^([0-9]{1,3})?(\.[0-9]{1,3}){0,3}$" under the release build, the program crashes. The stack trace shows that match_results<>::set_size() winds up invoking _invalid_parameter_noinfo(). I have seen this with both versions 1.33.1 and 1.34.1.
It would appear that visual studio 2008 is not a recognised build environment for boost but, despite the warning messages emitted in the boost headers, it has appeared to work until now. If anyone is aware of a way to work around this problem, I would appreciate their advice.
Works for me with VC9 and both current SVN Trunk and Boost-1.34.1. Dumb question - but I assume you rebuilt Boost.Regex with VC9 rather than trying to use the VC8 binaries? HTH, John.

John Maddock wrote:
Jon Trauntvein wrote:
I recently made the switch from visual studio 2005 to visual studio 2008. I have a project that uses boost regular expressions as shown in the following fragment:
bool StringCompDesc::is_valid_input(char const *s) { bool rtn = strlen(s) <= max_len; if(rtn && validate_pattern.length()) { boost::regex ex(validate_pattern.c_str()); boost::cmatch what;
rtn = boost::regex_match(s,what,ex); } return rtn; } // is_valid_input
When this method is invoked with a value of "192.168.4.230" and a validate_pattern value of "^([0-9]{1,3})?(\.[0-9]{1,3}){0,3}$" under the release build, the program crashes. The stack trace shows that match_results<>::set_size() winds up invoking _invalid_parameter_noinfo(). I have seen this with both versions 1.33.1 and 1.34.1.
It would appear that visual studio 2008 is not a recognised build environment for boost but, despite the warning messages emitted in the boost headers, it has appeared to work until now. If anyone is aware of a way to work around this problem, I would appreciate their advice.
Works for me with VC9 and both current SVN Trunk and Boost-1.34.1.
Dumb question - but I assume you rebuilt Boost.Regex with VC9 rather than trying to use the VC8 binaries?
Yes I did a complete rebuild of boost using VC9. One twist with the way that I use boost is that I always specify that the run time libraries must be static rather than dynamic. Regards, Jon Trauntvein

Jon Trauntvein wrote:
Yes I did a complete rebuild of boost using VC9. One twist with the way that I use boost is that I always specify that the run time libraries must be static rather than dynamic.
Still works for me: do you have a self contained test case you can let me have? John.
participants (2)
-
John Maddock
-
Jon Trauntvein