[Ffmpeg-devel] gcc 2.95 doesn't like snow.c
Dave Dodge
dododge
Fri Dec 30 18:05:33 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).
> + 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 ;-)
-Dave Dodge
More information about the ffmpeg-devel
mailing list