Error building gst-libav on Fedora 30 (gcc 9.0.1)
When building module gst-libav
on a Fedora 30 host system (with gcc 9.0.1) I'm getting errors like this:
CC libavformat/spdifdec.o
In file included from src/libavutil/common.h:488,
from src/libavutil/avutil.h:296,
from src/libavutil/samplefmt.h:24,
from src/libavcodec/avcodec.h:31,
from src/libavformat/avformat.h:319,
from src/libavformat/smjpegenc.c:27:
src/libavutil/mem.h:342:1: warning: ‘alloc_size’ attribute ignored on a function returning ‘int’ [-Wattributes]
342 | av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
| ^~~~~~~~~~~~~
In file included from src/libavutil/common.h:488,
from src/libavutil/avutil.h:296,
from src/libavutil/samplefmt.h:24,
from src/libavcodec/avcodec.h:31,
from src/libavformat/avformat.h:319,
from src/libavformat/smjpegdec.c:29:
This appears to be because of a change in gcc 9 which adds -Wattributes
to -Wall
, combined with forcing warnings to be treated as errors in the build.
Seems to fix it if I add CFLAGS=-Wno-attributes
to the autogenargs on the module.
Edited by Brooke Vibber (WMF)