Boost logo

Boost Users :

From: Christoph Duelli (duelli_at_[hidden])
Date: 2008-06-03 12:18:55


Eric Niebler wrote:

> Eric Niebler wrote:
>> Christoph Duelli wrote:
>>> Ok, checked it:
>>> I did indeed #ifdef out the lines stated in the last post.
>>>
>>> As I have said, the above two sections in regex_actions.hpp cause
>>> trouble. Even including regex_actions.hpp causes the compiler to choke
>>> on it. (see gcc-out1.txt for compiling just the header *with* these
>>> sections not
>>> #ifdef'ed out.
>>> )
>> <snip>
>>
>> I can't tell from the logs. I'm building gcc-3.3.3 now and will
>> investigate when that's done.
>
> Sorry, my gcc-3.3.3 build failed with:
>
> ../../gcc-3.3.3/gcc/gcc.c: In function `process_command':
> ../../gcc-3.3.3/gcc/gcc.c:3609: error: assignment of read-only location
> ../../gcc-3.3.3/gcc/gcc.c:3611: error: assignment of read-only location
Probably a case of "when gcc 3.3.3 was developed, they used an elder, more
forgiving C compiler." You're using a newer gcc (which finds more such
issues) to compile an older compiler.

> I'm giving up now. If you would like to pursue this, I would suggest you
> preprocess your test first and then reproduce the error. The line
> indicated by the error message contains a macro expansion. The error is
> somewhere in there. If you track it down and find a workaround, I'll
> gladly accept a patch.
>
> Good luck,
Thanks, I will need that ;-)

The warnings
boost/xpressive/traits/cpp_regex_traits.hpp:245: warning: comparison
   is always false due to limited range of data type

stem from template-code that is expanded to the following:

(is_newline)
   char ch;
   return L'\r' == ch
      || L'\n' == ch
      || L'\f' == ch
      || (1 < SizeOfChar
          && ( 0x2028u == ch
              || 0x2029u == ch
              || 0x85u == ch));

Seems that gcc3.3.3 is not happy about the (ignored) checks.
Well, I can live with that. (Not really happy, as I strive for warning free
code... but as you rightly said: a rather old compiler.)

When I find time to investigate Boost.Proto (otherwise my chances are rather
slime), I will look into the other stuff and try to find out more.

Best regards
Christoph

PS: The expanded macro stuff looks like that:

error: syntax error before `,' token:

template< typename X2_0, typename A0 >
typename boost::proto::result_of::make_expr<
      boost::proto::tag::function ,
      boost::proto::default_domain ,
      op::as < X2_0 > const ,
      const A0 >::type const
as( const A0 &a0) {
    return boost::proto::result_of::make_expr<
      boost::proto::tag::function ,
      boost::proto::default_domain ,
      op::as < X2_0 > const ,
      const A0 >::call(
         ( op::as < X2_0 >() ), a0 ); // <---- this line
}

and

error: syntax error before `)' token:

template< typename X2_0 >
typename boost::proto::result_of::make_expr<
      boost::proto::tag::function ,
      boost::proto::default_domain ,
      op::construct < X2_0 > const >::type const
construct()
{
    return boost::proto::result_of::make_expr<
      boost::proto::tag::function ,
      boost::proto::default_domain ,
      op::construct < X2_0 > const >::call(
         ( op::construct < X2_0 >() ) ); // <----- this line
}

Perhaps it is obvious to someone else?

(these two are typical of the errors)


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