public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
* does it matter how I construct an aggregate struct type if its size is the same?
@ 2015-12-18  6:47 Hayden Livingston
  2015-12-18  6:50 ` Hayden Livingston
  2015-12-18 11:08 ` Andrew Haley
  0 siblings, 2 replies; 9+ messages in thread
From: Hayden Livingston @ 2015-12-18  6:47 UTC (permalink / raw)
  To: libffi-discuss

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!

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-12-18 23:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-18  6:47 does it matter how I construct an aggregate struct type if its size is the same? Hayden Livingston
2015-12-18  6:50 ` Hayden Livingston
2015-12-18 11:08 ` Andrew Haley
2015-12-18 15:16   ` Hayden Livingston
2015-12-18 20:04     ` Andrew Haley
2015-12-18 21:42       ` Jay
2015-12-18 22:16         ` Hayden Livingston
2015-12-18 22:24           ` Andrew Haley
2015-12-18 23:10             ` Hayden Livingston

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).