closure api return value types problem
Andrew Haley
aph@redhat.com
Thu Apr 8 07:25:00 GMT 2010
On 07/04/10 20:10, Anthony Green wrote:
> On 04/07/2010 02:44 PM, Sergei Trofimovich wrote:
>> On Wed, 07 Apr 2010 08:48:17 +0100
>> Andrew Haley <aph@redhat.com> wrote:
>>
>>
>>>>> I think this is just because of the common (universal?) C ABI
>>>>> convention that integer typed return values of rank less than int are
>>>>> returned as a whole word, suitably sign- or zero-extended. It need
>>>>> not have been done that way.
>>>>>
>>>> The thing is:
>>>> * it's _very_ unintuitive (and not only for me) as that closure callback
>>>> (with args and resp parameters) is meant to be convention agnostic
>>>>
>>> Yes. I take your point.
>>>
>> How about changing it in libffi-4.x.y with slight API change to break
>> wrong assumptions?
>
> I'm open to API changes in 4.x if they make sense.
There's nothing slight about this API change, though. I think it
would break all clients of the closure interface, and wouldn't it mean
changing all the back-ends too? Perhaps it would make sense to add a
new API with the desired behaviour. Sometimes, even though a decision
may have been wrong, it makes more sense to keep it than to
retroactively make a change.
Andrew.
More information about the Libffi-discuss
mailing list