Possible problems with _RBTree_Container_of

Gedare Bloom gedare at rtems.org
Sat Nov 12 22:30:45 UTC 2011


I have filed PR1963 to address this. Thank you for the report.
-Gedare

On Wed, Nov 9, 2011 at 9:17 AM, Gedare Bloom <gedare at rtems.org> wrote:
> On Wed, Nov 9, 2011 at 4:13 AM, Ralf Corsepius <ralf.corsepius at rtems.org> wrote:
>> On 11/08/2011 11:59 PM, Gedare Bloom wrote:
>>>
>>> Hi Sebastien,
>>>
>>> I originally wrote this code, but I casted the node to a size_t. It
>>> looks like the macro was changed recently without a PR
>>
>> Correct, your code was multiliply broken, It likely only worked by random
>> accident on some targets.
>>
> Yes it depended on the size of size_t being the same as an address,
> which is not right. But removing the cast introduces the new problem
> that the type is completely ignored.
>
>>> so I must have
>>> missed it in the VC logs and will take a look.
>>
>> It was me.
>>
>>> The possible problem isn't really solved by casting to void*,
>>
>> Agreed - I don't see what add a cast to void* would fix.
>>
> Casting to uintptr_t might be a good idea; the compiler should get
> angry if something that isn't a pointer is given.
>
>> Ralf
>>
>



More information about the users mailing list