Bardur Arantsson wrote:
> Bardur Arantsson wrote:
>> Patrice Dumas wrote:
> [--snip--]
> 
> (I'm going to split my reply up because some of this could go on for a 
> while... I'll probably split the reply up over a couple of days as well.)
> 
>>>> The macro KEY_METAINFO_SIZE also has issues on my AMD64:
>>>>
>>>>     #define KEY_METAINFO_SIZE(k) ((unsigned int)&(k->recordSize) - 
>>>> unsigned int)k)
>>>>
>>>> is incorrect when the result is used as a "size_t" in various 
>>>> locations.
>>>> The correct definition is
>>>>
>>>>     #define KEY_METAINFO_SIZE(k) ((size_t)&(k->recordSize) - (size_t)k)
>>> Since recordSize is size_t in _Key, wouldn't it be even better to
>>> use
>>> #define KEY_METAINFO_SIZE(k) ((k->recordSize) - (size_t)k)
>>>
>>
>> Yup, I hadn't checked the definition of recordSize.
> 
> Reinvestigating this, the proper definition is as follows:
> 
>    #define KEY_METAINFO_SIZE(k) ((size_t) (((char *) (&k->recordSize)) 
> -   (char *) k)))
> 

Gah. Apparently the header file change didn't cause make to rebuild all 
the affected .c files. This still results in a warning from gcc about 
(size_t) being smaller than the pointer type.

The old code is subtly incorrect, so the patch should still be applied. 
I don't care enough to investigate further how the warning can be removed.

-- 
Bardur Arantsson
<[EMAIL PROTECTED]>

- Let your anger be like a monkey in a piƱata.
                                         The Old Master / Kung Pow


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Registry-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/registry-list

Reply via email to