[FFmpeg-devel] [PATCH] replace %td by more standard %zd

Uoti Urpala uoti.urpala
Wed Sep 30 15:52:17 CEST 2009


On Wed, 2009-09-30 at 15:17 +0200, Reimar D?ffinger wrote:
> personally I am more in favour of casting to int and using %i, but at
> least %zd is better supported it seems (e.g. Haiku compiler).

> -            av_log(avctx, AV_LOG_DEBUG, "%3X at %td left %d\n", start_code, buf_ptr-buf, input_size);
> +            av_log(avctx, AV_LOG_DEBUG, "%3X at %zd left %d\n", start_code, buf_ptr-buf, input_size);

%td is completely standard, so %zd cannot be any "more standard". The
result of pointer subtraction has type ptrdiff_t so %td is the most
correct one to use here. If some platform fails to handle such standard
printf features correctly isn't that a libc bug, not a compiler one
(unless the compiler inlines printf calls - and that can't really happen
here because of the indirection through av_log)?




More information about the ffmpeg-devel mailing list