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

François Revol revol
Fri Dec 30 18:08:52 CET 2005


> On Fri, Dec 30, 2005 at 05:36:00PM +0100, Fran?ois Revol wrote:
> > libavcodec/snow.c:3174: invalid use of non-lvalue array
> > 
> > either it's a gcc3 extention or whatever, but it doesn't work here.
> > I worked around it that way:
> > 
> > - check_block(s, mb_x, mb_y, (int[2]){block->mx, block->my}, 0, &
> > best_rd);
> 
> It's a compound literal, which is a standard feature of C99.  Note
> that it does create an lvalue (for example the array can be modified
> by the called function, and in general you can take the address of a
> compound literal).

Well fact is it doesn't work with 2.95.

> 
> > + check_block(s, mb_x, mb_y, ({int p[2] = {block->mx, block->my}; 
> > p;}),
> > 0, &best_rd);
> 
> Now _that_ is using a gcc extension ;-)

Yes but _that_ works. :P

Fran?ois.





More information about the ffmpeg-devel mailing list