[FFmpeg-devel] [PATCH] Replace all %t print prefixes with macros

Nicolas George nicolas.george at normalesup.org
Tue Aug 21 23:39:37 CEST 2012

Le quintidi 5 fructidor, an CCXX, Michael Niedermayer a écrit :
> is there a better identifer in C99 than PRIdPTR for ptrdiff_t ?

There is "%td", that is exactly that. Just like there is no PRIdLONG since
that is what "%ld" is for. All this is rather inconsistent¹, but there is
nothing much we can do about it.

I do not think that using PRIdPTR will cause any actual problem in any
actual architecture where ffmpeg works. I just wanted to mention the problem
for the record. At worst, it may go in the commit message.

1: but not completely inconsistent; it is true that ptrdiff_t is a typedef
as well as intptr_t or int64_t, but they do not have the same status:
intptr_t and int64_t are services to the programmer, they are never
necessary and no program will ever produce an intptr_t without explicitly
requesting it (it may produce a long long int which happens to be the same
type), while a program will produce a ptrdiff_t each time two pointers are
subtracted, this is a core feature of the language. End of rant.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120821/432dae86/attachment.asc>

More information about the ffmpeg-devel mailing list