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

Davinder Singh ds.mudhar at gmail.com
Sun May 22 03:51:05 CEST 2016


On Sun, May 22, 2016 at 2:09 AM Michael Niedermayer <michael at niedermayer.cc>
wrote:

> On Sat, May 21, 2016 at 02:21:17PM +0000, Davinder Singh wrote:
> > 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
>
> >  libavcodec/cfhd.c           |    6 +++---
> >  libavcodec/dv_tablegen.c    |    2 +-
> >  libavfilter/af_hdcd.c       |    2 +-
> >  libavfilter/vf_hwdownload.c |    6 ++++--
> >  libavutil/opencl.c          |    2 +-
>
> please split this patch
> the fixed warnings are unrelated to each other and possibly differnt
> developers would like to reply to different parts
>
> [...]
>
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> I have often repented speaking, but never of holding my tongue.
> -- Xenocrates
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-libavfilter-af_hdcd-fixed-negative-signed-value-shif.patch
Type: application/octet-stream
Size: 869 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160522/093a873e/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-libavutil-opencl-fixed-uninitialized-var-warning.patch
Type: application/octet-stream
Size: 786 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160522/093a873e/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-libavcodec-cfhd-fixed-wrong-printf-format.patch
Type: application/octet-stream
Size: 2180 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160522/093a873e/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-libavfilter-vf_hwdownload-show-error-when-ff_formats.patch
Type: application/octet-stream
Size: 946 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160522/093a873e/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-libavcodec-dv_tablegen-fixed-wrong-printf-format.patch
Type: application/octet-stream
Size: 760 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160522/093a873e/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-libavcodec-pngenc-fixed-assignment-discards-qualifie.patch
Type: application/octet-stream
Size: 813 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160522/093a873e/attachment-0005.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-libavcodec-tscc-fixed-assignment-discards-qualifier-.patch
Type: application/octet-stream
Size: 868 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160522/093a873e/attachment-0006.obj>


More information about the ffmpeg-devel mailing list