[Cbe-oss-dev] [patch 3/4] MARS: Fix build warnings

Kazunori Asayama asayama at sm.sony.co.jp
Mon Aug 25 14:04:16 EST 2008


Andrew Pinski wrote:
> On Sun, Aug 24, 2008 at 7:33 PM, Kazunori Asayama <asayama at sm.sony.co.jp> wrote:
>> Geoff Levand wrote:
>>> --- a/src/host/lib/mars_task.c
>>> +++ b/src/host/lib/mars_task.c
>>> @@ -95,7 +95,7 @@ int mars_task_initialize(struct mars_con
>>>                                (struct mars_workload_context *)&task,
>>>                                MARS_WORKLOAD_TYPE_TASK);
>>>        MARS_CHECK_CLEANUP_RET(ret == MARS_SUCCESS,
>>> -                               free((void *)task.context_save_area),
>>> ret);
>>> +                       free((void *)(uintptr_t)task.context_save_area),
>>> ret);
>>>        MARS_PRINT_TASK_CONTEXT(&task);
>> I suggest using a macro or a static inline function to convert EA from/to
>> pointer.
> 
> Even worse, if malloc earlier had returned a pointer that happens to
> have any bit 0-31 set, then we produce the incorrect code.  So getting

The task.context_save_area is uint64_t. Is it insufficient?

> rid of the warning here is just papering over the real issue,
> context_save_area should be an uintptr_t.

The task structure is shared between PPE and SPE, so we can't use 
uintptr_t. Additionally, we'd like to keep binary compatibility between 
MARS tasks for 32bit hosts and 64bit hosts, that is, we need to use a 
type with explicit size.

-- 
(ASAYAMA Kazunori
   (asayama at sm.sony.co.jp))
t



More information about the cbe-oss-dev mailing list