[FFmpeg-user] Reporting GCC 7.3.0 compiler-warnings on FFmpeg git (955fa23)

Reino Wijnsma rwijnsma at xs4all.nl
Sun Apr 22 01:48:13 EEST 2018


On 21-4-2018 22:47, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
>>>> libavutil/hwcontext_d3d11va.c: In function 'd3d11va_transfer_data':
>>>> libavutil/hwcontext_d3d11va.c:413:49: warning: passing argument 3 of
>>>> 'av_image_copy' from incompatible pointer type
>>> Does changing the third argument of av_image_copy() in
>>> libavutil/imgutils.h
>>> into "const uint8_t * const src_data[4]" silence anything?
>> I take it you meant this one?
> No, please copy the quotation above into the definition of
> av_image_copy().
> (You did not copy the quotation and changed another function
> definition).
>
> [...]
I'm feeling stupid now. Sorry.

diff --git a/libavutil/imgutils.h b/libavutil/imgutils.h
index 5b790ec..1183118 100644
--- a/libavutil/imgutils.h
+++ b/libavutil/imgutils.h
@@ -117,7 +117,7 @@ void av_image_copy_plane(uint8_t       *dst, int dst_linesize,
  * @param src_linesizes linesizes for the image in src_data
  */
 void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
-                   const uint8_t *src_data[4], const int src_linesizes[4],
+                   const uint8_t * const src_data[4], const int src_linesizes[4],
                    enum AVPixelFormat pix_fmt, int width, int height);
 
 /**

...leads to:

$ make libavutil/hwcontext_d3d11va.o
CC      libavutil/hwcontext_d3d11va.o
libavutil/hwcontext_d3d11va.c: In function 'd3d11va_transfer_data':
libavutil/hwcontext_d3d11va.c:413:49: warning: passing argument 3 of 'av_image_copy' from incompatible pointer type [-Wincompatible-pointer-types]
         av_image_copy(dst->data, dst->linesize, map_data, map_linesize,
                                                 ^~~~~~~~
In file included from libavutil/hwcontext_d3d11va.c:38:0:
libavutil/imgutils.h:119:6: note: expected 'const uint8_t * const* {aka const unsigned char * const*}' but argument is of type 'uint8_t ** {aka unsigned char **}'
 void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
      ^~~~~~~~~~~~~
libavutil/hwcontext_d3d11va.c:425:47: warning: passing argument 3 of 'av_image_copy' from incompatible pointer type [-Wincompatible-pointer-types]
         av_image_copy(map_data, map_linesize, src->data, src->linesize,
                                               ^~~
In file included from libavutil/hwcontext_d3d11va.c:38:0:
libavutil/imgutils.h:119:6: note: expected 'const uint8_t * const* {aka const unsigned char * const*}' but argument is of type 'uint8_t * const* {aka unsigned char * const*}'
 void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
      ^~~~~~~~~~~~~
In file included from libavutil/hwcontext_d3d11va.c:27:0:
libavutil/hwcontext_d3d11va.c: In function 'd3d11va_device_create':
libavutil/hwcontext_d3d11va.c:554:46: warning: passing argument 2 of 'pAdapter->lpVtbl->GetDesc' from incompatible pointer type [-Wincompatible-pointer-types]
         hr = IDXGIAdapter2_GetDesc(pAdapter, &desc);
                                              ^
libavutil/hwcontext_d3d11va.c:554:46: note: expected 'DXGI_ADAPTER_DESC * {aka struct DXGI_ADAPTER_DESC *}' but argument is of type 'DXGI_ADAPTER_DESC2 * {aka struct DXGI_ADAPTER_DESC2 *}'

and...

$ make libavutil/hwcontext_dxva2.o
CC      libavutil/hwcontext_dxva2.o
libavutil/hwcontext_dxva2.c: In function 'dxva2_transfer_data_to':
libavutil/hwcontext_dxva2.c:351:45: warning: passing argument 3 of 'av_image_copy' from incompatible pointer type [-Wincompatible-pointer-types]
     av_image_copy(map->data, map->linesize, src->data, src->linesize,
                                             ^~~
In file included from libavutil/hwcontext_dxva2.c:33:0:
libavutil/imgutils.h:119:6: note: expected 'const uint8_t * const* {aka const unsigned char * const*}' but argument is of type 'uint8_t * const* {aka unsigned char * const*}'
 void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],
      ^~~~~~~~~~~~~
libavutil/hwcontext_dxva2.c: In function 'dxva2_transfer_data_from':
libavutil/hwcontext_dxva2.c:382:52: warning: passing argument 3 of 'av_image_copy_uc_from' from incompatible pointer type [-Wincompatible-pointer-types]
     av_image_copy_uc_from(dst->data, dst_linesize, map->data, src_linesize,
                                                    ^~~
In file included from libavutil/hwcontext_dxva2.c:33:0:
libavutil/imgutils.h:137:6: note: expected 'const uint8_t ** {aka const unsigned char **}' but argument is of type 'uint8_t ** {aka unsigned char **}'
 void av_image_copy_uc_from(uint8_t *dst_data[4],       const ptrdiff_t dst_linesizes[4],
      ^~~~~~~~~~~~~~~~~~~~~

-- Reino



More information about the ffmpeg-user mailing list