[FFmpeg-trac] #9986(avutil:new): Compilation error [-Wincompatible-pointer-types] on AOSP for x86 (32bits)
FFmpeg
trac at avcodec.org
Sun Oct 23 12:49:10 EEST 2022
#9986: Compilation error [-Wincompatible-pointer-types] on AOSP for x86 (32bits)
-------------------------------------+----------------------------------
Reporter: goffioul | Owner: (none)
Type: defect | Status: new
Priority: normal | Component: avutil
Version: unspecified | Resolution:
Keywords: android | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+----------------------------------
Comment (by goffioul):
As the relevant code in libavutil/hwcontext_vaapi.c hasn't changed between
5.1.2 and current git head, the issue is still present there. It is also
not specific to Android, you just need the following combination: 32 bits
+ VA-API + libdrm.
So using current git head (65f96a965af415300f7533c75940eeae4e3a2287) and
the following configure line on Linux (Fedora 35, gcc 11.3.1):
{{{
PKG_CONFIG_PATH=/usr/lib/pkgconfig ../configure \
--disable-static --enable-shared \
--arch=x86 --cpu=i686 --build_suffix= \
--extra-cflags=-m32 --extra-ldflags=-m32 --disable-x86asm \
--extra-cflags=-Werror=incompatible-pointer-types \
--extra-cflags=-Werror=format \
--enable-libdrm
}}}
you reach the same compilation error:
{{{
CC libavutil/hwcontext_vaapi.o
src/libavutil/hwcontext_vaapi.c: In function ‘vaapi_map_from_drm’:
src/libavutil/hwcontext_vaapi.c:1216:34: error: assignment to ‘uintptr_t
*’ {aka ‘unsigned int *’} from incompatible pointer type ‘long unsigned
int *’ [-Werror=incompatible-pointer-types]
1216 | buffer_desc.buffers = &buffer_handle;
| ^
src/libavutil/hwcontext_vaapi.c: In function ‘vaapi_map_to_drm_abh’:
src/libavutil/hwcontext_vaapi.c:1514:51: error: format ‘%ld’ expects
argument of type ‘long int’, but argument 4 has type ‘uintptr_t’ {aka
‘unsigned int’} [-Werror=format=]
1514 | av_log(hwfc, AV_LOG_DEBUG, "DRM PRIME fd is %ld.\n",
| ~~^
| |
| long int
| %d
1515 | mapping->buffer_info.handle);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| uintptr_t {aka unsigned int}
cc1: some warnings being treated as errors
make: *** [src/ffbuild/common.mak:81: libavutil/hwcontext_vaapi.o] Error 1
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9986#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list