[FFmpeg-devel] [PATCH] mxfdec: make it work with other calling conventions

Baptiste Coudurier baptiste.coudurier
Thu Jul 1 02:05:14 CEST 2010


On 06/30/2010 04:50 PM, Reimar D?ffinger wrote:
> On Wed, Jun 30, 2010 at 04:20:50PM -0700, Baptiste Coudurier wrote:
>> On 06/30/2010 04:06 PM, Reimar D?ffinger wrote:
>>> On Wed, Jun 30, 2010 at 02:49:55PM -0700, Baptiste Coudurier wrote:
>>>>>> But that's more an explanation of
>>>>>> why there isn't any prototype for the read() function.
>>>>>
>>>>> I expected that is because pointers to functions with a different
>>>>> number of arguments were stored there, but that is more of an argument
>>>>> _for_ making it an error, since this allowed the fact that the
>>>>> code would crash with stdcall and all other calle-restores-stack calling
>>>>> conventions to go by unnoticed, without even a warning.
>>>>
>>>> All the functions are called with the same number of arguments.
>>>
>>> That's completely irrelevant, they are called with a different number
>>> of arguments than the number of arguments they are declared with!
>>
>> In any case, the compiler has to fail in this case, because
>> vararg/undefined prototype cannot work and stdcall requires a
>> function prototype.
>
> What? Whatever gave you that idea?
> Microsoft all those years has never noticed that none of their sofware
> can even compile?

http://msdn.microsoft.com/en-us/library/zxk0tw93(VS.71).aspx

The __stdcall calling convention is used to call Win32 API functions. 
The callee cleans the stack, so the compiler makes vararg functions 
__cdecl. Functions that use this calling convention require a function 
prototype.

-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list