[Ffmpeg-devel] printf format specifiers and 64-bit machines
Tue Dec 13 10:04:26 CET 2005
On Mon, Dec 12, 2005 at 02:02:55AM +0000, M?ns Rullg?rd wrote:
> 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.
wasn't usage of PRId64 discussed just this past week?
shouldn't perhaps configure check if PRId64 and PRIx64 are defined, and
define them if they aren't already?
not all OSes are fully C99 compliant yet.
<jakemsr at jakemsr.com>
> M?ns Rullg?rd
> mru at inprovide.com
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
More information about the ffmpeg-devel