[Ffmpeg-devel] gcc 2.95 doesn't like snow.c

Rich Felker dalias
Sat Dec 31 00:33:28 CET 2005


On Fri, Dec 30, 2005 at 10:06:48PM +0100, Fran?ois Revol wrote:
> >
> > IMO it does not work. The scope of the variable p has ended by the
> > time it is used, and its space on the stack may no longer belong to
> 
> Hmm it should, the last value of the block is supposed to be used as
> arg.
> Shouldn't gcc error if p was unreachable from that scope anyway ? *g*

The _value_ p is a pointer, and that's just fine. But it's a pointer
to an arrary that's no longer in scope.

> > it. Why not use the clean, portable:
> >
> > { int p[2] = {block->mx, block->my};
> >   check_block(s, mb_x, mb_y, p, 0, &best_rd); }
> >
> 
> Yeah...
> I've put that in an inline check_block_2p to avoid screwing up the
> indentation and readability.

Nice solution.

Rich






More information about the ffmpeg-devel mailing list