[FFmpeg-devel] GCC 5.1 warning: -Warray-bounds

Ganesh Ajjanagadde gajjanag at mit.edu
Thu Jun 4 04:05:54 CEST 2015

While compiling ffmpeg, I noticed a bunch of -Warray-bounds warnings.
I think it would be great if ffmpeg could be built warning-free, and
-Warray-bounds seems to be one of the biggest culprits. Nevertheless,
-Warray-bounds is quite useful in most cases.
I currently see 2 possible improvements:
1. using av_assert0() to ensure that array access remains in bounds in
these few cases. This could lead to performance hit.
2. creating a macro to disable this warning locally in the few places
to suppress this. This could be done on lines of AV_NOWARN_DEPRECATED
in libavutil/attributes.h. This is perhaps uglier.

Which option do the devs here prefer?

More information about the ffmpeg-devel mailing list