[FFmpeg-devel] [PATCH] fix few compiler warnings

Davinder Singh ds.mudhar at gmail.com
Sat May 21 16:21:17 CEST 2016


hi,

this patch fixes following compiler warnings:

libavcodec/cfhd.c:346:78: warning: format specifies type 'unsigned short'
but the argument has type 'int' [-Wformat]
            av_log(avctx, AV_LOG_DEBUG, "Small chunk length %"PRIu16"
%s\n", data * 4, tag < 0 ? "optional" : "required");
                                                            ~~
  ^~~~~~~~
libavcodec/cfhd.c:472:110: warning: format specifies type 'unsigned short'
but the argument has type 'int' [-Wformat]
            av_log(avctx, AV_LOG_DEBUG, "Start of lowpass coeffs component
%"PRIu16" height:%d, width:%d\n", s->channel_num, lowpass_height,
lowpass_width);

 ~~                                ^~~~~~~~~~~~~~
libavcodec/cfhd.c:490:77: warning: format specifies type 'unsigned short'
but the argument has type 'int' [-Wformat]
            av_log(avctx, AV_LOG_DEBUG, "Lowpass coefficients %"PRIu16"\n",
lowpass_width * lowpass_height);
                                                              ~~
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



libavcodec/dv_tablegen.c:30:60: warning: format specifies type 'char' but
the argument has type 'uint32_t' (aka 'unsigned int') [-Wformat]
                   "{0x%"PRIx32", %"PRId8"}", data[i].vlc, data[i].size)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
libavcodec/tableprint.h:37:29: note: expanded from macro
'WRITE_1D_FUNC_ARGV'
       printf(" "fmtstr",", __VA_ARGS__);\
                            ^~~~~~~~~~~
libavcodec/dv_tablegen.c:30:60: warning: format specifies type 'char' but
the argument has type 'uint32_t' (aka 'unsigned int') [-Wformat]
                   "{0x%"PRIx32", %"PRId8"}", data[i].vlc, data[i].size)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~



libavfilter/af_hdcd.c:896:57: warning: shifting a negative signed value is
undefined [-Wshift-negative-value]
            state->readahead = readaheadtab[bits & ~(-1 << 8)];



libavfilter/vf_hwdownload.c:59:5: warning: ignoring return value of
function declared with warn_unused_result attribute [-Wunused-result]
    ff_formats_ref(infmts,  &avctx->inputs[0]->out_formats);
    ^~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libavfilter/vf_hwdownload.c:60:5: warning: ignoring return value of
function declared with warn_unused_result attribute [-Wunused-result]
    ff_formats_ref(outfmts, &avctx->outputs[0]->in_formats);
    ^~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



libavutil/opencl.c:456:17: warning: variable 'kernel_source' is used
uninitialized whenever 'for' loop exits because its condition is false
[-Wsometimes-uninitialized]
    for (i = 0; i < opencl_ctx.kernel_code_count; i++) {
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libavutil/opencl.c:466:10: note: uninitialized use occurs here
    if (!kernel_source) {
         ^~~~~~~~~~~~~
libavutil/opencl.c:456:17: note: remove the condition if it is always true
    for (i = 0; i < opencl_ctx.kernel_code_count; i++) {
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libavutil/opencl.c:448:30: note: initialize the variable 'kernel_source' to
silence this warning
    const char *kernel_source;
                             ^
                              = NULL
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fixed-few-compiler-warnings.patch
Type: application/octet-stream
Size: 4346 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160521/1f4bf392/attachment.obj>


More information about the ffmpeg-devel mailing list