[FFmpeg-devel] [PATCH] Replace all %t print prefixes with macros
Michael Niedermayer
michaelni at gmx.at
Wed Aug 22 00:10:35 CEST 2012
On Tue, Aug 21, 2012 at 11:39:37PM +0200, Nicolas George wrote:
> 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.
indeed
but what now with the patch?
"t" amongth others seems disliked by mingw
"warning: unknown conversion type character 't' in format [-Wformat]"
on http://fate.ffmpeg.org/log.cgi?time=20120821134044&log=compile&slot=x86_64-debian-mingw32-gcc-4.6
we can either leave it and blame mingw
change to PRIdPTR and hope thats not going to have sideeffects
btw doesnt this add type mismatch warnings somewhere ?
or add our own identifer and set it appropriately depending on target
I have no real preferance but it should be changed in some way that
works on the major platforms
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
What does censorship reveal? It reveals fear. -- Julian Assange
-------------- 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/20120822/aec6dc52/attachment.asc>
More information about the ffmpeg-devel
mailing list