On Wed, 23 Apr 2008, Andy Dougherty wrote:

> 2.  There are some casting and type-punning warnings that have, as their
> ultimate cause, the STACK_DATAP() macro.  Getting rid of the
> type-punning warning gives rise to a cast alignment warning.
> 
> Looking up a level, the only uses for that macro are to return
> Stack_Entry_t pointers.  Why not be explicit about it in the definition
> in include/parrot/stacks.h?  The attached patch tries to do just that.
> I haven't tested this, but it looks like it ought to work.

Oops.  It won't work because I missed a level of indirection.

> -    return STACK_DATAP(new_chunk);

That used to return  &(new_chunk->u.data)

> +    return new_chunk->u.stdata;

And this returns new_chunk->u.stdata instead.

Oops.  I can only say I was fooled by the function signatures that these 
functions returned 'void *', when they actually return 'void **'.

I'll try to fix that.  I apologize in advance if I wasted anyone's time 
trying this out.  (I still think my basic premise is right -- we can avoid 
pointer cast warnings and problems if we declare more explicitly what we 
wish to do.)

-- 
    Andy Dougherty              [EMAIL PROTECTED]

Reply via email to