Ran into a strange problem with boost::regex today. I get this just
from including boost/regex.hpp:
powerbook:~/Desktop/bre_test richard$ make
g++ -pedantic -Wall -g -I/usr/local/include/boost-1_33_1/ -c -o
bre_test.o bre_test.cpp
/usr/local/include/boost-1_33_1/boost/regex/v4/perl_matcher_non_recursive.hpp:
In member function `bool boost::re_detail::perl_matcher
Richard Dingwall wrote:
Ran into a strange problem with boost::regex today. I get this just from including boost/regex.hpp:
That is indeed weird: I'm unable to reproduce this (cygwin g++ 3.4.4), and the error is coming from: BOOST_ASSERT(rep->next.p != 0); which is surely legal code! You could try disabling BOOST_ASSERT I guess, or just comment out the offending line. Which g++ version are you using? Also does this occur without the -pedantic option? John.
Ah it works fine without -pedantic.
powerbook:~ richard$ g++ -v
Reading specs from /usr/lib/gcc/powerpc-apple-darwin8/4.0.0/specs
Configured with: /private/var/tmp/gcc/gcc-4061.obj~8/src/configure
--disable-checking --prefix=/usr --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^+.-]*$/s/$/-4.0/
--with-gxx-include-dir=/include/gcc/darwin/4.0/c++
--build=powerpc-apple-darwin8 --host=powerpc-apple-darwin8
--target=powerpc-apple-darwin8
Thread model: posix
gcc version 4.0.0 20041026 (Apple Computer, Inc. build 4061)
powerbook:~ richard$
Hope that helps.
On 11/17/06, John Maddock
Richard Dingwall wrote:
Ran into a strange problem with boost::regex today. I get this just from including boost/regex.hpp:
That is indeed weird: I'm unable to reproduce this (cygwin g++ 3.4.4), and the error is coming from:
BOOST_ASSERT(rep->next.p != 0);
which is surely legal code!
You could try disabling BOOST_ASSERT I guess, or just comment out the offending line. Which g++ version are you using? Also does this occur without the -pedantic option?
John.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Just to follow up, will this be fixed in a future version? I believe
that all boost libaries should compile without warnings or errors with
the -pedantic option (indeed it becomes a PITA for me while building
my own code that uses boost::regex).
Richard
On 11/17/06, Richard Dingwall
Ah it works fine without -pedantic.
powerbook:~ richard$ g++ -v Reading specs from /usr/lib/gcc/powerpc-apple-darwin8/4.0.0/specs Configured with: /private/var/tmp/gcc/gcc-4061.obj~8/src/configure --disable-checking --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^+.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/gcc/darwin/4.0/c++ --build=powerpc-apple-darwin8 --host=powerpc-apple-darwin8 --target=powerpc-apple-darwin8 Thread model: posix gcc version 4.0.0 20041026 (Apple Computer, Inc. build 4061) powerbook:~ richard$
Hope that helps.
On 11/17/06, John Maddock
wrote: Richard Dingwall wrote:
Ran into a strange problem with boost::regex today. I get this just from including boost/regex.hpp:
That is indeed weird: I'm unable to reproduce this (cygwin g++ 3.4.4), and the error is coming from:
BOOST_ASSERT(rep->next.p != 0);
which is surely legal code!
You could try disabling BOOST_ASSERT I guess, or just comment out the offending line. Which g++ version are you using? Also does this occur without the -pedantic option?
John.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Richard Dingwall wrote:
Just to follow up, will this be fixed in a future version? I believe that all boost libaries should compile without warnings or errors with the -pedantic option (indeed it becomes a PITA for me while building my own code that uses boost::regex).
Right, how do we fix it? Does changing: BOOST_ASSERT(rep->next.p != 0); BOOST_ASSERT(rep->alt.p != 0); In perl_matcher_non_recursive.hpp, line 1043 To: BOOST_ASSERT(rep->next.p); BOOST_ASSERT(rep->alt.p); Fix the issue? Oh no wait, that can't be done because of this issue: http://64.233.183.104/search?q=cache:Aqknf5ncceYJ:lists.boost.org/MailArchives/boost-users/msg06614.php+BOOST_ASSERT+regex+site:lists.boost.org&hl=en&gl=uk&ct=clnk&cd=1&client=firefox-a This is already the fixed version :-( Are you able to try with gcc-4.0.1 or later? I'm pretty certain this is a compiler bug, as: assert(my_pointer_type != 0); should compile, whether we're in pedantic mode or not. Otherwise we're going to be adding more BOOST_WORKAROUNDS :-( Thanks, John.
participants (2)
-
John Maddock
-
Richard Dingwall