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

Andrew Pinski pinskia at gmail.com
Mon Aug 25 12:39:55 EST 2008


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
rid of the warning here is just papering over the real issue,
context_save_area should be an uintptr_t.

-- Pinski



More information about the cbe-oss-dev mailing list