freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] LLP64 model outside Win64


From: Werner LEMBERG
Subject: Re: [ft-devel] LLP64 model outside Win64
Date: Sun, 11 Feb 2018 19:30:19 +0100 (CET)

>>  (void*)(size_t)(x) should be safe, c90, and warning-less.
> 
> You assume that all machines have a flat, linear memory model.... ;-(
> 
> The "safe", portable way is to use
>
>   (void *)(((char *)0) + (x))
>
> to cast an integer to a void pointer, and use
>
>   (ptrdiff_t)((char *)(x)) - ((char *)0)
>
> to cast a pointer to an integer.

Interesting.  Can you name an example of a machine with a non-linear
memory model?


    Werner



reply via email to

[Prev in Thread] Current Thread [Next in Thread]