Bug 5221

Summary: Build with dependency on libavutil fails on Fedora 30
Product: Fedora Reporter: Roland Hermans <rolandh>
Component: ffmpegAssignee: Dominik 'Rathann' Mierzejewski <dominik>
Status: RESOLVED FIXED    
Severity: normal CC: belegdol, kwizart, leigh123linux
Priority: P1    
Version: f30   
Hardware: x86_64   
OS: GNU/Linux   
namespace:

Description Roland Hermans 2019-04-06 09:46:56 CEST
The header file /usr/include/ffmpeg/libavutil/mem.h contains an invalid use of the alloc_size attribute on the function av_reallocp_array that causes the rpmbuild of bs1770gain 0.5.2 to fail on Fedora 30.

In file included from /usr/include/ffmpeg/libavutil/common.h:488,
                 from /usr/include/ffmpeg/libavutil/avutil.h:296,
                 from /usr/include/ffmpeg/libavutil/samplefmt.h:24,
                 from /usr/include/ffmpeg/libavcodec/avcodec.h:31,
                 from /usr/include/ffmpeg/libavformat/avformat.h:319,
                 from ./ffsox_dynload.h:25,
                 from ./ffsox.h:27,
                 from ./ffsox_priv.h:23,
                 from ffsox_aggregate.c:20:
/usr/include/ffmpeg/libavutil/mem.h:342:1: error: ‘alloc_size’ attribute ignored on a function returning ‘int’ [-Werror=attributes]
  342 | av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
      | ^~~~~~~~~~~~~
cc1: all warnings being treated as errors

Note that this issue was fixed upstream [1] in the master branch in November 2018 but the fix is not included in the recently released ffmpeg 4.1.3.

References:
[1] https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/4361293fcf59edb56879c36edcd25f0a91e0edf8
Comment 1 Nicolas Chauvet 2019-04-06 09:57:22 CEST
Thx for the report.

Can you consider to maintain bs1770gain within RPM Fusion ? 
That would better help to track this kind of issue early.
https://rpmfusion.org/Contributors

It would be better to have this backport made into the related ffmpeg upstream branches, but I think ffmpeg upstream gave up to provide good maintenance releases and this is unfortunate because it leads us to be an interface between end-users and upstream.

See also rfbz#5149 for a similar case.
Comment 2 leigh scott 2019-04-06 10:05:33 CEST
Sorry backporting this is a zero priority for me, perhaps you should override the gcc warning/error instead

cc1: all warnings being treated as errors
Comment 3 leigh scott 2019-04-06 10:24:53 CEST
The code is doomed to fail, remove -Werror and run 'autoreconf -fiv' to regenerate configure.


https://github.com/petterreinholdtsen/bs1770gain/commit/aee42beb4e8f09c0329e3eeb8c1f54793b387c15#diff-33e98e94bfc3f78e2404a35c6d65b3a1R17