[Ffmpeg-devel] printf format specifiers and 64-bit machines

Måns Rullgård mru
Mon Dec 12 03:02:55 CET 2005

Aurelien Jacobs <aurel at gnuage.org> writes:

> On Sun, 11 Dec 2005 15:26:00 -0800
> Mike Melanson <mike at multimedia.cx> wrote:
>> M?ns Rullg?rd wrote:
>> > I compiled ffmpeg on my Alpha today, and noticed a large number of
>> > warnings about %lld or %Ld used with int64_t arguments, as int64_t is
>> > a plain long on Alpha (both long and long long are 64 bits).  Would it
>> > be acceptable to replace all of these with the proper PRId64 and
>> > related macros?  As these are already used in one or two places, I
>> > don't see any problem with it.
>> What is the solution exactly? Can you explain this PRId64 thing? I
>> see the same issue all the time on my AMD64.
> On 32 bits system, you need to use %lld to display an int64_t. But
> on 64 bits systems, you simply need %ld to display an int64_t. For
> that purpose, C99 defines some macros, such as PRId64, which expand
> to the right string needed to display an int64_t on the host system
> (ie. either "%ld" or "%lld").

It gets even worse with types like int_fast16_t.  They are usually 64
bits on 64-bit machines.

> IMHO, using PRId64 is the right thing to do. And as it's already
> used at some places, it certainly can't generate troubles to add
> some more.  If you do this search and replace effort, this would
> probably be welcomed.

Done.  Let's see if anyone complains.

M?ns Rullg?rd
mru at inprovide.com

More information about the ffmpeg-devel mailing list