Boost logo

Boost Users :

Subject: Re: [Boost-users] [Regex] problems compiling with gcc 4.4
From: John Maddock (john_at_[hidden])
Date: 2008-12-14 13:13:31


Aonghus Lawlor wrote:
>> Thanks for the suggestion- I tried this line:
>>
>> const std::locale locale;
>> const std::messages<char>& msgs = std::use_facet<
>> std::messages<char> >( locale );
>>
>> but it makes no difference- the program still crashes only with
>> gcc-4.4, and not previous versions.

I don't follow: does the above code run OK, but regex still crashes?

>> This is the compile command I am using (on osx):
>>
>> g++-mp-4.4 -g -o boost_test_regex boost_test_regex.C
>> -I/opt/local/include/boost -L/opt/local/lib -lboost_regex-mt
>>
>> and it terminates like this:
>>
>> $ ./boost_test_regex
>> terminate called after throwing an instance of 'std::bad_cast'
>> what(): std::bad_cast
>> Abort trap
>>
>> The gcc-4.4 is from macports, and was working fine with the rest of
>> my code, until I ran into this problem with boost:
>>
>> $ g++-mp-4.4 -v
>> Using built-in specs.
>> Target: i386-apple-darwin9.5.0
>> Configured with: ../gcc-4.4-20081128/configure --prefix=/opt/local
>> --enable-languages=c,c++,objc,obj-c++ --libdir=/opt/local/lib/gcc44
>> --includedir=/opt/local/include/gcc44 --infodir=/opt/local/share/info
>> --mandir=/opt/local/share/man --with-local-prefix=/opt/local
>> --with-system-zlib --disable-nls --program-suffix=-mp-4.4
>> --with-gxx-include-dir=/opt/local/include/gcc44/c++/
>> --with-gmp=/opt/local
>> --with-mpfr=/opt/local
>> Thread model: posix
>> gcc version 4.4.0 20081128 (experimental) (GCC)
>>
>>
>> I'm not really familiar with the usage of locale's and use_facet's ,
>> so I'm grateful for any other suggestions you might have,

None at present, other than use a released version of gcc rather than the
current 4.4 development branch. Probably your best bet is to report this as
a bug to the gcc folks - if you need help in figuring out a test case let me
know - but as I don't have access to that platform you'll have to do most of
the work!

Cheers, John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net