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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Reino Wijnsma
Hello ffmpeg-user(/devel),

I've just compiled a fresh build from git (955fa23) (on Windows using Cygwin, MinGW and GCC).
It compiled without errors, but I did get quite some warnings! I thought I'd share it with you.
See the attached 'ffmpeg_build.log'.

-- Reino

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

ffmpeg_build.log (216K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Reporting GCC 7.3.0 compiler-warnings on FFmpeg git (955fa23)

Reino Wijnsma
On 15-4-2018 15:16, Reino Wijnsma <[hidden email]> wrote:
> Hello ffmpeg-user(/devel),
>
> I've just compiled a fresh build from git (955fa23) (on Windows using Cygwin, MinGW and GCC).
> It compiled without errors, but I did get quite some warnings! I thought I'd share it with you.
> See the attached 'ffmpeg_build.log'.
On 16-4-2018 0:00, Carl Eugen Hoyos <[hidden email]> wrote <https://ffmpeg.org/pipermail/ffmpeg-devel/2018-April/228297.html>:
> Attached patch is supposed to silence several user-reported warnings,
> I cannot currently test here.
>
> Please review, Carl Eugen
[...]
CC      libavcodec/dxva2.o
CC      libavcodec/dxva2_h264.o
CC      libavcodec/dxva2_hevc.o
CC      libavcodec/dxva2_mpeg2.o
CC      libavcodec/dxva2_vc1.o
CC      libavcodec/dxva2_vp9.o
[...]

On 16-4-2018 0:03, Carl Eugen Hoyos <[hidden email]> wrote <https://ffmpeg.org/pipermail/ffmpeg-devel/2018-April/228299.html>:
> Attached patch is supposed to silence a user-reported warning, I
> cannot currently test.
>
> libavdevice/vfwcap.c: In function 'vfw_read_header':
> libavdevice/vfwcap.c:331:35: warning: passing argument 1 of 'av_parse_video_size' from incompatible pointer type [-Wincompatible-pointer-types]
>          ret = av_parse_video_size(&bi->bmiHeader.biWidth, &bi->bmiHeader.biHeight, ctx->video_size);
>                                    ^
>
> Please review, Carl Eugen
[...]
CC      libavdevice/vfwcap.o
[...]

On 16-4-2018 0:19, Carl Eugen Hoyos <[hidden email]> wrote <https://ffmpeg.org/pipermail/ffmpeg-devel/2018-April/228300.html>:
> rtmpe_write() exploits knowledge about av_rc4_crypt() internals and
> passes the same
> pointer as src and dst. I assume this is intentional for performance
> reasons, the only
> way to silence the resulting warning is a cast afaict.
>
> Please comment, Carl Eugen
[...]
CC      libavformat/rtmpcrypt.o
[...]

On 16-4-2018 1:33, Carl Eugen Hoyos <[hidden email]> wrote <https://ffmpeg.org/pipermail/ffmpeg-devel/2018-April/228305.html>:
> Attached patch is supposed to silence a user-reported warning when
> inet_aton() is missing but getaddrinfo() is supported.
> Untested.
>
> Please review, Carl Eugen
[...]
CC      libavformat/os_support.o
libavformat/os_support.c: In function 'ff_poll':
libavformat/os_support.c:248:23: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
         if (fds[i].fd < 0)
                       ^
[...]

As you can see, no more warnings. Good job. Thanks. (The 'os_support.o'-warning above wasn't the warning that Carl fixed)

-- Reino
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Reporting GCC 7.3.0 compiler-warnings on FFmpeg git (955fa23)

Carl Eugen Hoyos-2
In reply to this post by Reino Wijnsma
2018-04-15 15:16 GMT+02:00, Reino Wijnsma <[hidden email]>:

> I've just compiled a fresh build from git (955fa23) (on Windows using
> Cygwin, MinGW and GCC).

> It compiled without errors, but I did get quite some warnings!

I think you get a small number but anyway.
The main reason this wasn't tested lately was that last gcc
showed a larger number of invalid warnings.

[...]

> libavfilter/vf_frei0r.c:193:30: warning: unused variable 'frei0r_pathlist'

Compiler bug?

> ./compat/avisynth/avisynth_c.h

Not maintained within FFmpeg.

> libavformat/hlsenc.c: In function 'get_default_pattern_localtime_fmt':
> libavformat/hlsenc.c:1676:63: warning: unknown conversion type character 's' in format
>         return (HAVE_LIBC_MSVCRT || !strftime(b, sizeof(b), "%s", p)

What does "grep HAVE_LIBC_MSVCRT config.h" show for you?

> libavformat/os_support.c:248:23: warning: comparison of unsigned expression < 0 is always false
>          if (fds[i].fd < 0)

fd is signed here, I doubt this can be silenced.

> 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?
(Only hwcontext_d3d11va.o testing required, breaks imgutils.o compilation)

> 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 *}'

I wonder if this is a bug...

Silenced a few others, Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Reporting GCC 7.3.0 compiler-warnings on FFmpeg git (955fa23)

Reino Wijnsma
On 19-4-2018 12:13, Carl Eugen Hoyos <[hidden email]> wrote:
>> libavformat/hlsenc.c: In function 'get_default_pattern_localtime_fmt':
>> libavformat/hlsenc.c:1676:63: warning: unknown conversion type character 's' in format
>>         return (HAVE_LIBC_MSVCRT || !strftime(b, sizeof(b), "%s", p)
> What does "grep HAVE_LIBC_MSVCRT config.h" show for you?
#define HAVE_LIBC_MSVCRT 0

>> 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?

diff --git a/libavutil/imgutils.h b/libavutil/imgutils.h
index 5b790ec..9530c6e 100644
--- a/libavutil/imgutils.h
+++ b/libavutil/imgutils.h
@@ -107,7 +107,7 @@ int av_image_alloc(uint8_t *pointers[4], int linesizes[4],
  * @param src_linesize linesize for the image plane in src
  */
 void av_image_copy_plane(uint8_t       *dst, int dst_linesize,
-                         const uint8_t *src, int src_linesize,
+                         const uint8_t *src_data[4], int src_linesize,
                          int bytewidth, int height);
 
 /**

Result: same warning messages as before.

> (Only hwcontext_d3d11va.o testing required, breaks imgutils.o compilation)
I'm still rather new to all of this and normally I would always run make on FFmpeg. Can you tell me how I can compile just this one file?

-- Reino

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Reporting GCC 7.3.0 compiler-warnings on FFmpeg git (955fa23)

Carl Eugen Hoyos-2
2018-04-19 13:22 GMT+02:00, Reino Wijnsma <[hidden email]>:
> On 19-4-2018 12:13, Carl Eugen Hoyos <[hidden email]> wrote:
>>> libavformat/hlsenc.c: In function 'get_default_pattern_localtime_fmt':
>>> libavformat/hlsenc.c:1676:63: warning: unknown conversion type character
>>> 's' in format
>>>         return (HAVE_LIBC_MSVCRT || !strftime(b, sizeof(b), "%s", p)
>> What does "grep HAVE_LIBC_MSVCRT config.h" show for you?
> #define HAVE_LIBC_MSVCRT 0

Patch sent (I believe it was rejected before and I cannot test).

>>> 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).

[...]

>> (Only hwcontext_d3d11va.o testing required, breaks imgutils.o compilation)
> I'm still rather new to all of this and normally I would always run make on
> FFmpeg. Can you tell me how I can compile just this one file?

$ make libavutil/hwcontext_d3d11va.o

Thank you, Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Reporting GCC 7.3.0 compiler-warnings on FFmpeg git (955fa23)

Reino Wijnsma
On 21-4-2018 22:47, Carl Eugen Hoyos <[hidden email]> 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

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".