This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
does it matter how I construct an aggregate struct type if its size is the same?
- From: Hayden Livingston <halivingston at gmail dot com>
- To: libffi-discuss at sourceware dot org
- Date: Thu, 17 Dec 2015 22:46:55 -0800
- Subject: does it matter how I construct an aggregate struct type if its size is the same?
- Authentication-results: sourceware.org; auth=none
This may be a fundamental question, but does it matter how a struct is
constructed if its size is accurate to the receiving function? That is
if it was made up of all int8s vs. a combination of other types?
My scenario is that I have a receiving function whose actual struct
type information I do not know, but I know its size, so I was thinking
I could just build it up using int8 ffi_type and hope for the best.
Is this correct in the most popular ABIs (x86, x64, arm -
windows/Linux/macosx) that all the ABI and compilers that generate
code respecting those ABI care only about size and alignment?
I suspect so, but I'm not sure if there are quirks? Maybe on Windows?
Thanks!