[Ffmpeg-devel] Re: [patch] fixes for some compiler warnings
Thu Feb 16 06:32:44 CET 2006
On Wed, Feb 15, 2006 at 07:40:11PM +0000, Dieter wrote:
> > 64-bit architectures often have 32-bit ints and 64-bit pointers.
> Modern general purpose machines are either ILP32 or LP64.
The 64-bit version of Windows is actually LLP64 (commence groaning).
int and long remain 32 bits, while long long and pointers are 64 bits.
The idea was to make it as close as possible to ILP32 in order to
avoid breaking [badly designed] APIs, file formats, and 3rd party
software. As you might expect, some developers are not exactly happy
about this. Here's a lengthy discussion:
> Thus, it is reasonable to assume that long and pointer are the same
> size, but it is not safe to assume that int and long are the same
> size, nor to assume that int and pointer are the same size.
C99 provides the best solution: if you need to store a pointer in an
integer for some reason, the intptr_t and uintptr_t typedefs will give
you an integer type large enough to reliably hold a void*. These
typedefs are admittedly optional, but should exist on normal systems
and even Microsoft's compiler supports them.
More information about the ffmpeg-devel