[FFmpeg-devel] Eliminating long

Uoti Urpala uoti.urpala
Mon Mar 31 01:43:38 CEST 2008


On Mon, 2008-03-31 at 00:15 +0100, Jay L. T. Cornwall wrote:
> fact, you would never find the ideal language. Likewise, I can guarantee 
> that FFmpeg's own developers have made assumptions about type sizes all 
> over the code base that violate the standard. There's a trade-off 

Actually there aren't that many assumptions.

> I'll rephrase this, if this makes a better incentive: ByteIOContext is 
> type unsafe if anyone is interpreting ByteIOContext.checksum field to be 
> anything other than a uint32_t.

It's only unsafe if you interpret it to guarantee something else than
what you can expect from "long" in the environment(s) you want to
support. IMO that shouldn't be too hard to get right.

>  It would fail catastrophically under the 
> choice of your compiler, including a mainstream compiler on a mainstream 
> platform (VC x64).

This is a fundamental misconception on your part. It's not the compiler
with determines the size of 'long', unlike what you had in your table
("GCC 64-bit"). It's the platform and its ABI that determines what the
compilers must produce. If gcc and VC produced different sizes _for the
same ABI_ that would not be just a compiler difference but a blatant bug
in at least one of them.





More information about the ffmpeg-devel mailing list