[Ffmpeg-devel] Re: [patch] fixes for some compiler warnings

Rich Felker dalias
Fri Feb 17 04:08:24 CET 2006


On Thu, Feb 16, 2006 at 12:32:44AM -0500, Dave Dodge wrote:
> 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.

You mean MSVC is LLP64. Other compilers are free to do the correct
thing. Hopefully cygwin/mingw gcc do.

> > 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.

Agree, this is the best solution in general. However wasting long as a
32bit type is incredibly stupid.

Rich





More information about the ffmpeg-devel mailing list