[FFmpeg-devel] [PATCH] fix libswscale+altivec+-std=gnu99 compile
Alexander Strange
astrange
Thu Jul 17 01:05:58 CEST 2008
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.
I can compile on ppc+gnu99 with apple gcc 3.3 and 4.2 with this patch.
Does anyone else have problems with it?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ppc-fix-2.diff
Type: text/x-diff
Size: 3866 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080716/f1e86042/attachment.diff>
-------------- next part --------------
More information about the ffmpeg-devel
mailing list