Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

lvalue casts don't work

1 view
Skip to first unread message

Andy Dougherty

unread,
Oct 1, 2003, 12:38:25 PM10/1/03
to Perl6 Internals
Building with Sun's Workshop compiler, I'm currently getting stuck when
comiling core_ops.c with the message:

"bit.ops", line 349: a cast does not yield an lvalue
"bit.ops", line 349: a cast does not yield an lvalue

Sure enough, line 349 in bit.ops is

((UINTVAL) $1 >>= $2;

I don't know enough about .ops file syntax to suggest a fix offhand.

--
Andy Dougherty doug...@lafayette.edu

Leopold Toetsch

unread,
Oct 1, 2003, 1:08:23 PM10/1/03
to Andy Dougherty, Perl6 Internals
Andy Dougherty wrote:

> Building with Sun's Workshop compiler, I'm currently getting stuck when
> comiling core_ops.c with the message:
>
> "bit.ops", line 349: a cast does not yield an lvalue
> "bit.ops", line 349: a cast does not yield an lvalue
>
> Sure enough, line 349 in bit.ops is
>
> ((UINTVAL) $1 >>= $2;

*(UINTVAL*) $1


should do the trick.


leo


Andy Dougherty

unread,
Oct 1, 2003, 3:27:05 PM10/1/03
to Leopold Toetsch, Perl6 Internals
On Wed, 1 Oct 2003, Leopold Toetsch wrote:

> Andy Dougherty wrote:
>
> > Building with Sun's Workshop compiler, I'm currently getting stuck when
> > comiling core_ops.c with the message:
> >
> > "bit.ops", line 349: a cast does not yield an lvalue

> > ((UINTVAL) $1 >>= $2;

> *(UINTVAL*) $1
>
> should do the trick.

Thanks. That lets the compile succeed. I still fail t/op/bitwise test 7;
I don't yet know if it's related. I'll need to investigate further.

--
Andy Dougherty doug...@lafayette.edu

Luke Palmer

unread,
Oct 1, 2003, 6:18:31 PM10/1/03
to Andy Dougherty, Leopold Toetsch, Perl6 Internals
Andy Dougherty writes:
> On Wed, 1 Oct 2003, Leopold Toetsch wrote:
>
> > Andy Dougherty wrote:
> >
> > > Building with Sun's Workshop compiler, I'm currently getting stuck when
> > > comiling core_ops.c with the message:
> > >
> > > "bit.ops", line 349: a cast does not yield an lvalue
>
> > > ((UINTVAL) $1 >>= $2;
>
> > *(UINTVAL*) $1
> >
> > should do the trick.

The compiling trick. But that makes me shiver in my boots.

*(UINTVAL*) &$1

Luke

Leopold Toetsch

unread,
Oct 2, 2003, 3:41:59 AM10/2/03
to Luke Palmer, perl6-i...@perl.org
Luke Palmer <fibo...@babylonia.flatirons.org> wrote:
> The compiling trick. But that makes me shiver in my boots.

> *(UINTVAL*) &$1

Yep. Thanks for the correction. Anyway I've checked in a snippet posted
here some time ago by Benjamin Goldberg. This defines:

LVALUE_CAST(type, value)

So above line in bit.ops is now:

LVALUE_CAST(UINTVAL, $1) >>= $2;

> Luke

leo

0 new messages