[Ecls-list] Problem building from git

Gabriel Dos Reis gdr at integrable-solutions.net
Mon Feb 2 03:04:42 UTC 2009


On Sun, Feb 1, 2009 at 6:52 PM, Geo Carncross <geocar at gmail.com> wrote:
> On Sun, Feb 1, 2009 at 3:50 PM, Gabriel Dos Reis
> <gdr at integrable-solutions.net> wrote:
>>
>>   (int)(intptr_t)file
>>
>> since intptr_t is garanteed to be precise enough to hold
>> a value of type void*.
>
> Well, casting it to (int) [if that causes problems] would simply truncate it
> again anyway- even though it was originally cast to intptr_t
>

In earlier conversation, Juanjo seemed to suggest that
the value there really was an int. So the truncation was OK.
My point in my preceding message is that the mapping
from void* to int is highly unportable (anyone to guess standard
semantics?), compared to the mapping from void* to intptr_t,
which although implementation-defined is guaranteed to yield
the original int value back.

My personal inclination would be to use a union of void* and int,
and select the appropriate field, thereby not depending on any
implementation defined assumption at all.  That also would
make the intent clearer.

-- Gaby




More information about the ecl-devel mailing list