[FFmpeg-devel] How to handle compiler warnings

Luca Abeni lucabe72
Tue Jan 29 13:47:38 CET 2008

Hi all,

Diego Biurrun wrote:
> The topic has come up again, it's time to discuss the subject.  I
> propose to try to avoid compiler warnings as much as possible in order
> to
> - have cleaner code,
> - have important warnings not be drowned out,
> - make FFmpeg a programming textbook.
> This does not include warning fixes that slow things down or obfuscate
> the code, but if in doubt I personally would err on the side of fixing
> the warning.
I agree about removing the number of warnings, if this is done in the
correct way (avoiding useless casts, etc...); if there are warnings that
cannot be removed without slowing down or obfuscating the code, maybe we
should add a comment like
/* The following line might generate a warning, because...
  * The warning cannot be easily removed without slowing the code because..
in the code. In this way, we can avoid having people that submit wrong
patches for removing such warnings.

Finally, maybe we can have a configure option for enabling all the
possible warnings, and one for -Werror (both options disabled by


More information about the ffmpeg-devel mailing list