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

Hendrik Leppkes h.leppkes at gmail.com
Thu Jun 4 08:43:43 CEST 2015


On Thu, Jun 4, 2015 at 4:05 AM, Ganesh Ajjanagadde <gajjanag at mit.edu> wrote:
> 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?

3. Fix the compiler to stop false-positives, and don't litter the code
with workarounds.


More information about the ffmpeg-devel mailing list