$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: Jon Trauntvein (j.trauntvein_at_[hidden])
Date: 2008-03-27 19:29:15
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