On 07 Feb 2014, at 19:12, Diego Biurrun <[email protected]> wrote: > On Fri, Feb 07, 2014 at 06:01:01PM +0000, Janne Grunau wrote: >> On 2014-02-07 18:45:50 +0100, Diego Biurrun wrote: >>> On Fri, Feb 07, 2014 at 06:39:38PM +0100, Janne Grunau wrote: >>>> --- a/libavcodec/dcadec.c >>>> +++ b/libavcodec/dcadec.c >>>> @@ -1587,7 +1587,12 @@ static int dca_exss_parse_asset_header(DCAContext >>>> *s) >>>> case 2: extensions_mask = DCA_EXT_EXSS_LBR; break; >>>> - case 3: extensions_mask = 0; /* aux coding */ break; >>>> + case 3: >>>> + /* default covers nothing just silences a warning since the compiler >>>> does >>>> + * not know the range of get_bits(2)'s return values */ >>>> + default: >>>> + extensions_mask = 0; /* aux coding */ >>>> + break; >>>> } >>> >>> I don't see any warning here, with gcc 4.8.1. >> >> I see the following with gcc 4.8.2 and gcc-4.6.3 >> >> gcc -I. -I/home/janne/src/libav -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 >> -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 >> -DHAVE_AV_CONFIG_H -march=corei7-avx -std=c99 -fomit-frame-pointer -pthread >> -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/opus -g >> -Wdeclaration-after-statement -Wall -Wdisabled-optimization -Wpointer-arith >> -Wredundant-decls -Wcast-qual -Wwrite-strings -Wtype-limits -Wundef >> -Wmissing-prototypes -Wstrict-prototypes -Wno-parentheses -Wno-switch >> -Wno-format-zero-length -Wno-pointer-sign -O3 -fno-math-errno >> -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration >> -Werror=missing-prototypes -Werror=return-type >> -Werror=declaration-after-statement -Werror=vla -MMD -MF >> libavcodec/dcadec.d -MT libavcodec/dcadec.o -c -o libavcodec/dcadec.o >> /home/janne/src/libav/libavcodec/dcadec.c >> /home/janne/src/libav/libavcodec/dcadec.c: In function >> ‘dca_exss_parse_header’: >> /home/janne/src/libav/libavcodec/dcadec.c:1604:25: warning: >> ‘extensions_mask’ may be used uninitialized >> in this function [-Wuninitialized] >> /home/janne/src/libav/libavcodec/dcadec.c:1480:9: note: ‘extensions_mask’ >> was declared here > > I have -Wno-maybe-uninitialized in that compiler command line, which > makes the warning go away. I wonder why you don't ...
I don't have that warning turned off in any of my builds either… there are quite a few occurrences of this warning type throughout libav, actually. Tim _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
