This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: does it matter how I construct an aggregate struct type if its size is the same?
- From: Andrew Haley <aph at redhat dot com>
- To: Hayden Livingston <halivingston at gmail dot com>
- Cc: libffi-discuss at sourceware dot org
- Date: Fri, 18 Dec 2015 20:04:33 +0000
- Subject: Re: does it matter how I construct an aggregate struct type if its size is the same?
- Authentication-results: sourceware.org; auth=none
- References: <CAMxMwy+ATViiyo4Znn4-jhmoKNEDWbHUxFPOmK6sX9_Lxd_j0w at mail dot gmail dot com> <5673E92C dot 7090400 at redhat dot com> <CAMxMwyJq-FH9gwvtJ3-AOnHoDUfdY2Oj8E2pSeNpHj42Wdif0g at mail dot gmail dot com>
On 18/12/15 15:16, Hayden Livingston wrote:
> Thanks, Andrew. Where is this exception? In ABIs?
>
> So you're suggesting I use char's to construct my ffi_types?
Well, it can be awkward. Some targets pass the components of a
struct in registers. But this only matters if you pass a struct
by value, which is a fairly unusual thing to do in C. If you're
passing a struct by reference, then yes, you can just create a
char array of the right size.
Andrew.