[FFmpeg-devel] forcing ints to be 64 bits, possible new FATE client idea

Mark Harris mark.hsj at gmail.com
Wed Oct 21 07:14:36 CEST 2015

On Tue, Oct 20, 2015 at 7:08 PM, Ganesh Ajjanagadde <gajjanag at mit.edu> wrote:
> Hi all,
> It is known that there exist at least certain parts of the codebase
> that do not work correctly if ints are 64 bits. One of them I noticed
> was in avutil/intmath.h: ff_ctz_c does not compute the right thing if
> int is 64 bits. This is true both before and after the De-Bruijn
> optimization.
> A more interesting (and serious) question is whether FATE is broken if
> int's are 64 bits. I did some digging, and found the following from
> "The Definitive Guide to GCC" - On GCC prior to 4.x, there was a flag
> -mint64, documented as follows (see e.g
> https://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc.pdf):
> "Force int and long types to be 64 bits wide. See -mlong32 for an
> explanation of the default and the way that the pointer size is
> determined".
> This should be helpful in setting up a FATE client to test (and
> possibly fix) bad code that assumed int = 32 bits. I myself can't
> easily run such an outdated GCC, but I noticed a bunch of clients
> running GCC < 4.0 where this may be set up.

This option was only valid on MIPS targets, not on x86_64 or other
common platforms.  It produced code that was incompatible with the
ABI, which made it not very useful if you want to link with system
libraries.  It was therefore removed.

Although it would be possible to modify gcc to add a new x86_64 target
where int is 64 bits, you would probably have the same ABI issues
because libc and other system libraries would be assuming a 32-bit

> Regards,
> Ganesh

More information about the ffmpeg-devel mailing list