[cfe-dev] Clang::SemaCXX/reinterpret-cast.cpp failing

Sean Hunt rideau3 at gmail.com
Sun Nov 22 14:14:42 PST 2009


Ahmed Charles wrote:
> 
>     "longs and pointers are 64 bits, and the rest is 32 bits or less" and
>     "long longs and pointers are 64 bits, and the rest (including long) is
>     32 bits".  I think LLP64 is sometimes also called P64.  In short, on
>     Windows, you've got sizeof(long) == 4, no matter if you're running in
>     32 bit or 64 bit mode.  But on most UNIX systems, sizeof(long) ==
>     sizeof(void *), so it is 8 in 64 bit mode.
> 
> 
> Interesting, I didn't know that. Thanks. I thought long was always 32 
> bits, not sure why.

Long is always at least 32 bits, but can be longer if the implementation 
chooses so (even on 32-bit platforms)

Sean



More information about the cfe-dev mailing list