does it matter how I construct an aggregate struct type if its size is the same?
Andrew Haley
aph@redhat.com
Fri Dec 18 11:08:00 GMT 2015
On 18/12/15 06:46, Hayden Livingston wrote:
> 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?
Yes, it does. But there is a specific exception for character types:
a character type is permitted to alias all other types. So it's
always safe to use an array of char, say, to hold anything. (Without
this rule, malloc() would not work.)
Andrew.
More information about the Libffi-discuss
mailing list