[FFmpeg-devel] [PATCH 1/4] Remove unnecessary mem.h inclusions

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Thu Feb 4 02:05:05 EET 2021


Michael Niedermayer:
> On Wed, Feb 03, 2021 at 11:27:46AM +0100, Andreas Rheinhardt wrote:
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
>> ---
>>  fftools/ffmpeg_qsv.c                        | 1 -
>>  libavcodec/aactab.c                         | 1 -
>>  libavcodec/arbc.c                           | 1 -
>>  libavcodec/argo.c                           | 1 -
>>  libavcodec/dcadsp.c                         | 1 -
>>  libavcodec/dss_sp.c                         | 1 -
>>  libavcodec/dvbsub_parser.c                  | 1 -
>>  libavcodec/h264_redundant_pps_bsf.c         | 1 -
>>  libavcodec/libvo-amrwbenc.c                 | 1 -
>>  libavcodec/mpegaudiodsp_template.c          | 1 -
>>  libavcodec/opustab.h                        | 2 --
>>  libavcodec/rl.c                             | 1 -
>>  libavcodec/snappy.c                         | 2 --
>>  libavcodec/truemotion2rt.c                  | 1 -
>>  libavcodec/v210dec.c                        | 1 -
>>  libavcodec/v210x.c                          | 1 -
>>  libavcodec/x86/ac3dsp_init.c                | 1 -
>>  libavcodec/x86/lpc.c                        | 2 +-
>>  libavcodec/x86/rv40dsp_init.c               | 1 -
>>  libavcodec/x86/vc1dsp_mmx.c                 | 1 -
>>  libavcodec/x86/videodsp_init.c              | 1 -
>>  libavcodec/x86/vp8dsp_init.c                | 1 -
>>  libavcodec/x86/vp9dsp_init.c                | 1 -
>>  libavcodec/x86/vp9dsp_init_16bpp_template.c | 1 -
>>  libavdevice/fbdev_dec.c                     | 1 -
>>  libavdevice/fbdev_enc.c                     | 1 -
>>  libavdevice/libcdio.c                       | 1 -
>>  libavfilter/boxblur.h                       | 1 -
>>  libavfilter/drawutils.c                     | 1 -
>>  libavfilter/vf_deinterlace_vaapi.c          | 1 -
>>  libavfilter/vf_misc_vaapi.c                 | 1 -
>>  libavfilter/vf_neighbor_opencl.c            | 1 -
>>  libavfilter/vf_overlay_cuda.c               | 1 -
>>  libavfilter/vf_overlay_opencl.c             | 1 -
>>  libavfilter/vf_procamp_vaapi.c              | 1 -
>>  libavfilter/vf_scale_vaapi.c                | 1 -
>>  libavfilter/vf_tonemap_opencl.c             | 1 -
>>  libavfilter/vf_tonemap_vaapi.c              | 1 -
>>  libavfilter/vf_transpose_opencl.c           | 1 -
>>  libavfilter/vf_transpose_vaapi.c            | 1 -
>>  libavfilter/vf_xfade_opencl.c               | 1 -
>>  libavfilter/video.c                         | 1 -
>>  libavfilter/x86/vf_atadenoise_init.c        | 1 -
>>  libavfilter/x86/vf_bwdif_init.c             | 1 -
>>  libavfilter/x86/vf_eq_init.c                | 1 -
>>  libavfilter/x86/vf_gradfun_init.c           | 1 -
>>  libavfilter/x86/vf_idet_init.c              | 1 -
>>  libavfilter/x86/vf_maskedclamp_init.c       | 1 -
>>  libavfilter/x86/vf_transpose_init.c         | 1 -
>>  libavfilter/x86/vf_w3fdif_init.c            | 1 -
>>  libavfilter/x86/vf_yadif_init.c             | 1 -
>>  libavformat/replaygain.c                    | 1 -
>>  libavutil/avsscanf.c                        | 1 -
>>  libavutil/tests/aes_ctr.c                   | 1 -
>>  libavutil/tx_priv.h                         | 1 -
>>  tests/checkasm/llviddspenc.c                | 1 -
>>  tests/checkasm/sw_rgb.c                     | 1 -
>>  tests/checkasm/sw_scale.c                   | 1 -
>>  tools/ffhash.c                              | 1 -
>>  59 files changed, 1 insertion(+), 61 deletions(-)
> 
> breaks build on arm
> 
> make -j32 tools/ffhash.o 
> 
> WARNING: src/libavformat/allformats.c src/libavcodec/parsers.c newer than config.h, rerun configure
> 
> CC	tools/ffhash.o
> src/tools/ffhash.c: In function ‘check’:
> src/tools/ffhash.c:87:63: error: implicit declaration of function ‘strerror’; did you mean ‘perror’? [-Werror=implicit-function-declaration]
>          printf("%s=OPEN-FAILED: %s:", av_hash_get_name(hash), strerror(errno));
>                                                                ^~~~~~~~
>                                                                perror
> src/tools/ffhash.c:87:34: warning: format ‘%s’ expects argument of type ‘char *’, but argument 3 has type ‘int’ [-Wformat=]
>          printf("%s=OPEN-FAILED: %s:", av_hash_get_name(hash), strerror(errno));
>                                  ~^                            ~~~~~~~~~~~~~~~
>                                  %d
> src/tools/ffhash.c:99:36: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat=]
>              printf("+READ-FAILED: %s", strerror(err));
>                                    ~^   ~~~~~~~~~~~~~
>                                    %d
> src/tools/ffhash.c: In function ‘main’:
> src/tools/ffhash.c:136:22: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat=]
>              printf("%s\n", strerror(errno));
>                      ~^     ~~~~~~~~~~~~~~~
>                      %d
> cc1: some warnings being treated as errors
> src/ffbuild/common.mak:67: recipe for target 'tools/ffhash.o' failed
> make: *** [tools/ffhash.o] Error 1
> 
> 
Thanks for the report. I have only checked for whether the relevant
translation unit uses any of the alloc/free functions (because
DECLARE_ALIGNED is already provided by mem_internal.h), but I have not
taken into account stuff that is included by the headers included by
mem.h. In this case, one needs string.h (which is included in
libavutil/common.h which in turn is included in avutil.h which is
included in mem.h). Will look over everything again.

- Andreas

PS: It actually seems that the only thing provided by avutil.h that
mem.h uses is size_t. Do we allow to remove included headers from
installed headers at major version bumps?


More information about the ffmpeg-devel mailing list