[Ffmpeg-devel] Re: [Ffmpeg-cvslog] r8420 - trunk/libavcodec/dv.c

John Dalgliesh johnd
Mon Mar 26 01:51:01 CEST 2007


On Sun, 25 Mar 2007, Rich Felker wrote:
> On Sun, Mar 25, 2007 at 03:40:22PM +0300, Uoti Urpala wrote:
>> I think the only sane way to work with the current gcc is to assume that
>> the stack _will_ be 16-byte aligned inside FFmpeg. If there are problems
>
> This is blatently incorrect though, and not dependent on gcc. Even if
> you use gcc 4.x, my crt0/libc does not align the stack, and will not
> align the stack, ever. It's wasteful and stupid. You can't just make
> nonportable assumptions based on what one OS does incestuously with
> latest gcc.

What exactly is the problem here? Yes technically the ABI only requires 
4-byte aligned stack. And yes gcc doesn't seem capable of aligning to 
better than the stack alignment. But this doesn't affect the correctness 
of the code!

So _if_ you encounter a platform with stack alignment problems, your 
choices are either:
- Use a compiler that can align properly (or fix gcc)
- Work around gcc's deficiency in the platform ... 'incestuously' if you 
must
- Send patch with workaround to ffmpeg devs and compelling argument for 
your case

I don't like your chances with option 3 'tho given what I remember of the 
response the last time this came up (ffmpeg called from some Windows 
compiler).

But regardless, the only way you can call it nonportable is if you also 
make the (nonportable) assumption of using broken gcc.

> Rich

{P^/




More information about the ffmpeg-devel mailing list