[FFmpeg-devel] Clang run from 20100402

matthieu castet castet.matthieu
Sat Apr 3 21:14:57 CEST 2010


Justin Ruggles <justin.ruggles <at> gmail.com> writes:

> Michael Niedermayer wrote:
> All of the FLAC and AC-3 reports are false warnings.
> At least the clang mistakes seem to be similar in nature.  I'm finding
> mostly that they have to do with value bounds.  Where we correctly
> assume certain bounds for a variety of reasons, but clang does not
> recognize those bounds and takes branch combinations that cannot exist.
May be building without assembler optimisation could help clang to analyse 
bound checking.

For flac [1] in decode_subframe, clang have no way to know that 
"type = get_bits(&s->gb, 6);" will return something between 0 and 1<<6 - 1.
get_bits use SHOW_UBITS that use NEG_USR32 that is an asm inline for x86.
With the C version (a shift on a unsigned), clang will know the bound of 


[1] http://tranquillity.ath.cx/clang/2010-04-02-1/report-Y0SzSn.html#EndPath

More information about the ffmpeg-devel mailing list