[FFmpeg-devel] [PATCH] fix libswscale+altivec+-std=gnu99 compile

Måns Rullgård mans
Thu Jul 17 01:09:30 CEST 2008


Alexander Strange <astrange at ithinksw.com> writes:

> On Jul 16, 2008, at 1:30 PM, compn wrote:
>
>> On Sun, 13 Jul 2008 18:29:00 -0400, Alexander Strange wrote:
>>>
>>> On Jul 13, 2008, at 6:05 PM, Diego Biurrun wrote:
>>>
>>>> On Sun, Jul 13, 2008 at 05:13:49PM -0400, Alexander Strange wrote:
>>>>> See subject. I tested it via cross-compile.
>>>>
>>>> I committed something similar for two files in libavcodec/ppc with
>>>> Luca's blessing, so I expect this to be OK as well.
>>>>
>>>> Diego
>>>
>>> Applied.
>>
>>
>> is this a new problem?
>>
>> [cami:~/Desktop/mplayer/libswscale] compn% make
>> gcc-3.3 -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -
>> D_LARGEFILE_SOURCE -D_ISOC9X_SOURCE -I.. -I.. -I. -W -Wall -O2 -
>> mcpu=7450 -mtune=7450 -pipe -g3  -faltivec -mdynamic-no-pic -falign-
>> loops=16 -shared-libgcc -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -
>> D_LARGEFILE64_SOURCE -DHAVE_CONFIG_H -I/usr/local/include -I/usr/
>> X11R6/include -I/opt/local/include/freetype2 -I/opt/local/include
>> -
>> c -o yuv2rgb_altivec.o yuv2rgb_altivec.c
>> yuv2rgb_altivec.c:147: warning: left-hand operand of comma
>> expression has no effect
>> yuv2rgb_altivec.c:147: error: incompatible types in initialization
>> yuv2rgb_altivec.c:147: error: initializer element is not constant
>
> It looks like it. I thought gcc 4 behaved like 3.3, but apparently not.
>
> It looks like having uncasted AVV() with 3.3 is problematic. And, even
> worse, it will compile altivec constants with the {} syntax, but if
> you leave out the cast it'll drop all but the first four members and
> write zeroes instead. It also breaks if you do:
> vector signed short a = (vector unsigned short)...
> which makes writing short macros harder.

It's things like this that give compiler intrinsics a bad reputation,
and deservedly so.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list