[FFmpeg-devel] [PATCH] work around some 'may be used uninitialized warnings'

Diego Biurrun diego
Wed Mar 4 23:31:46 CET 2009


On Wed, Mar 04, 2009 at 10:48:39PM +0100, Aurelien Jacobs wrote:
> Diego Biurrun wrote:
> 
> > Here is a patch to work around the 'may be used uninitialized warnings'
> > in libavformat, please review.  I will commit individual parts if OKed,
> > not before.
> > 
> > A bunch of these warnings seem to be legitimate.  I initialized these
> > variables to 0, but probably somebody should have a closer look at the
> > code.
> > 
> > [...]
> > 
> > --- libavformat/matroskadec.c	(revision 17759)
> > +++ libavformat/matroskadec.c	(working copy)
> > @@ -947,7 +947,7 @@
> >  {
> > -    char *line, *layer, *ptr = pkt->data, *end = ptr+pkt->size;
> > +    char *line, *av_uninit(layer), *ptr = pkt->data, *end = ptr+pkt->size;
> >      for (; *ptr!=',' && ptr<end-1; ptr++);
> >      if (*ptr == ',')
> >          layer = ++ptr;
> 
> I have no warning at all here regarding this file (gcc-4.3.3).
> Do you use an old gcc version or something like that, to get this warning?

I get the warning with gcc <4.3 only, so I guess we can disregard this hunk.

Diego




More information about the ffmpeg-devel mailing list