How to call 'printf' using libffi?

Andrew Haley aph@redhat.com
Fri Mar 19 11:43:02 GMT 2021


On 3/19/21 11:01 AM, Anthony Green wrote:
>>>   ffi_prep_cif_var(&cif, FFI_DEFAULT_ABI, 1, 3, &ffi_type_sint,
>> arg_types);
>>
>> Surely that only works if a varargs call uses the same ABI as a normal
>> call. They don't always,
>>
> I'm using the '_var' variant of ffi_prep_cif that takes this into account.

Aha! Missed it.

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671



More information about the Libffi-discuss mailing list