
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<BidiIterator, Allocator, traits>::unwind_greedy_single_repeat(bool)': /usr/local/include/boost-1_33_1/boost/regex/v4/perl_matcher_non_recursive.hpp:991: error: invalid conversion from 'boost::re_detail::re_syntax_base*' to 'long int' /usr/local/include/boost-1_33_1/boost/regex/v4/perl_matcher_non_recursive.hpp:992: error: invalid conversion from 'boost::re_detail::re_syntax_base*' to 'long int' /usr/local/include/boost-1_33_1/boost/regex/v4/perl_matcher_non_recursive.hpp: In member function `bool boost::re_detail::perl_matcher<BidiIterator, Allocator, traits>::unwind_slow_dot_repeat(bool)': /usr/local/include/boost-1_33_1/boost/regex/v4/perl_matcher_non_recursive.hpp:1041: error: invalid conversion from 'boost::re_detail::re_syntax_base*' to 'long int' /usr/local/include/boost-1_33_1/boost/regex/v4/perl_matcher_non_recursive.hpp:1042: error: invalid conversion from 'boost::re_detail::re_syntax_base*' to 'long int' /usr/local/include/boost-1_33_1/boost/regex/v4/perl_matcher_non_recursive.hpp: In member function `bool boost::re_detail::perl_matcher<BidiIterator, Allocator, traits>::unwind_char_repeat(bool)': /usr/local/include/boost-1_33_1/boost/regex/v4/perl_matcher_non_recursive.hpp:1159: error: invalid conversion from 'boost::re_detail::re_syntax_base*' to 'long int' /usr/local/include/boost-1_33_1/boost/regex/v4/perl_matcher_non_recursive.hpp:1160: error: invalid conversion from 'boost::re_detail::re_syntax_base*' to 'long int' /usr/local/include/boost-1_33_1/boost/regex/v4/perl_matcher_non_recursive.hpp: In member function `bool boost::re_detail::perl_matcher<BidiIterator, Allocator, traits>::unwind_short_set_repeat(bool)': /usr/local/include/boost-1_33_1/boost/regex/v4/perl_matcher_non_recursive.hpp:1223: error: invalid conversion from 'boost::re_detail::re_syntax_base*' to 'long int' /usr/local/include/boost-1_33_1/boost/regex/v4/perl_matcher_non_recursive.hpp:1224: error: invalid conversion from 'boost::re_detail::re_syntax_base*' to 'long int' /usr/local/include/boost-1_33_1/boost/regex/v4/perl_matcher_non_recursive.hpp: In member function `bool boost::re_detail::perl_matcher<BidiIterator, Allocator, traits>::unwind_long_set_repeat(bool)': /usr/local/include/boost-1_33_1/boost/regex/v4/perl_matcher_non_recursive.hpp:1288: error: invalid conversion from 'boost::re_detail::re_syntax_base*' to 'long int' /usr/local/include/boost-1_33_1/boost/regex/v4/perl_matcher_non_recursive.hpp:1289: error: invalid conversion from 'boost::re_detail::re_syntax_base*' to 'long int' make: *** [bre_test.o] Error 1 powerbook:~/Desktop/bre_test richard$ A test case is attached. OS X version: Darwin powerbook.local 8.8.0 Darwin Kernel Version 8.8.0: Fri Sep 8 17:18:57 PDT 2006; root:xnu-792.12.6.obj~1/RELEASE_PPC Power Macintosh powerpc

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 <john@johnmaddock.co.uk> 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

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 <rdingwall@gmail.com> wrote:
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 <john@johnmaddock.co.uk> 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