Opened 7 months ago
Closed 6 months ago
#11004 closed defect (fixed)
libavutil/hwcontext_qsv.c does not compile with GCC 14 (MinGW)
Reported by: | Marcos Mello | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avutil |
Version: | 7.0 | Keywords: | |
Cc: | Marcos Mello | Blocked By: | |
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
-Wincompatible-pointer-types
now errors out on GCC 14:
https://gcc.gnu.org/gcc-14/porting_to.html#incompatible-pointer-types
How to reproduce:
$ x86_64-w64-mingw32-gcc --version x86_64-w64-mingw32-gcc (GCC) 14.0.1 20240127 (Fedora MinGW 14.0.1-1.fc40) Copyright (C) 2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ PKG_CONFIG_PATH="$(pwd)/3rd-party/lib/pkgconfig" PKG_CONFIG_SYSROOT_DIR="$(pwd)" ./configure --target-os=mingw32 --arch=x86_64 --cross-prefix=x86_64-w64-mingw32- --disable-everything --enable-libvpl --enable-filter=vpp_qsv $ make [...] CC libavutil/hwcontext_qsv.o libavutil/hwcontext_qsv.c: In function 'qsv_d3d11_update_config': libavutil/hwcontext_qsv.c:696:70: warning: format '%d' expects argument of type 'int', but argument 4 has type 'HRESULT' {aka 'long int'} [-Wformat=] 696 | av_log(ctx, AV_LOG_ERROR, "Error IDXGIDevice_GetAdapter %d\n", hr); | ~^ ~~ | | | | int HRESULT {aka long int} | %ld libavutil/hwcontext_qsv.c:703:68: warning: format '%d' expects argument of type 'int', but argument 4 has type 'HRESULT' {aka 'long int'} [-Wformat=] 703 | av_log(ctx, AV_LOG_ERROR, "Error IDXGIAdapter_GetDesc %d\n", hr); | ~^ ~~ | | | | int HRESULT {aka long int} | %ld libavutil/hwcontext_qsv.c:707:71: warning: format '%d' expects argument of type 'int', but argument 4 has type 'HRESULT' {aka 'long int'} [-Wformat=] 707 | av_log(ctx, AV_LOG_ERROR, "Error ID3D11Device_QueryInterface %d\n", hr); | ~^ ~~ | | | | int HRESULT {aka long int} | %ld libavutil/hwcontext_qsv.c: In function 'qsv_d3d9_update_config': libavutil/hwcontext_qsv.c:766:60: warning: format '%d' expects argument of type 'int', but argument 4 has type 'HRESULT' {aka 'long int'} [-Wformat=] 766 | av_log(ctx, AV_LOG_ERROR, "Error OpenDeviceHandle %d\n", hr); | ~^ ~~ | | | | int HRESULT {aka long int} | %ld In file included from libavutil/hwcontext_dxva2.h:34, from libavutil/hwcontext_qsv.c:39: libavutil/hwcontext_qsv.c:770:68: error: passing argument 3 of 'devmgr->lpVtbl->LockDevice' from incompatible pointer type [-Wincompatible-pointer-types] 770 | hr = IDirect3DDeviceManager9_LockDevice(devmgr, device_handle, &device, TRUE); | ^~~~~~~ | | | IDirect3DDevice9Ex ** libavutil/hwcontext_qsv.c:770:68: note: expected 'IDirect3DDevice9 **' but argument is of type 'IDirect3DDevice9Ex **' libavutil/hwcontext_qsv.c:772:54: warning: format '%d' expects argument of type 'int', but argument 4 has type 'HRESULT' {aka 'long int'} [-Wformat=] 772 | av_log(ctx, AV_LOG_ERROR, "Error LockDevice %d\n", hr); | ~^ ~~ | | | | int HRESULT {aka long int} | %ld libavutil/hwcontext_qsv.c:779:82: warning: format '%d' expects argument of type 'int', but argument 4 has type 'HRESULT' {aka 'long int'} [-Wformat=] 779 | av_log(ctx, AV_LOG_ERROR, "Error IDirect3DDevice9_GetCreationParameters %d\n", hr); | ~^ ~~ | | | | int HRESULT {aka long int} | %ld In file included from libavutil/hwcontext_dxva2.h:33: libavutil/hwcontext_qsv.c:784:49: error: passing argument 2 of 'device->lpVtbl->GetDirect3D' from incompatible pointer type [-Wincompatible-pointer-types] 784 | hr = IDirect3DDevice9Ex_GetDirect3D(device, &d3d9ex); | ^~~~~~~ | | | IDirect3D9Ex ** libavutil/hwcontext_qsv.c:784:49: note: expected 'IDirect3D9 **' but argument is of type 'IDirect3D9Ex **' libavutil/hwcontext_qsv.c:786:77: warning: format '%d' expects argument of type 'int', but argument 4 has type 'HRESULT' {aka 'long int'} [-Wformat=] 786 | av_log(ctx, AV_LOG_ERROR, "Error IDirect3DDevice9Ex_GetAdapterLUID %d\n", hr); | ~^ ~~ | | | | int HRESULT {aka long int} | %ld libavutil/hwcontext_qsv.c:793:77: warning: format '%d' expects argument of type 'int', but argument 4 has type 'HRESULT' {aka 'long int'} [-Wformat=] 793 | av_log(ctx, AV_LOG_ERROR, "Error IDirect3DDevice9Ex_GetAdapterLUID %d\n", hr); | ~^ ~~ | | | | int HRESULT {aka long int} | %ld libavutil/hwcontext_qsv.c: In function 'qsv_frames_derive_from': libavutil/hwcontext_qsv.c:1372:13: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] 1372 | AVD3D11VAFramesContext *dst_hwctx = dst_ctx->hwctx; | ^~~~~~~~~~~~~~~~~~~~~~ make: *** [ffbuild/common.mak:81: libavutil/hwcontext_qsv.o] Error 1
Note:
See TracTickets
for help on using tickets.
Fixed by
https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/45d31614bcc54c5ccbaabf07e7336ac477e2b424