Q
qarnos
Hi, all.
A while ago I posted a question about storage alignment (thread
"Calculating storage alignment") and your answers were very helpful,
so I was hoping you could help me out again.
My question is straighforward:
Given two structs,
struct foo
{
void * a;
unsigned b;
char c;
};
struct bar
{
unsigned b;
char c;
};
Is there any guarantee that the alignment of "c" in both structures,
relative to "b", will be the same?
I'd like to think "yes", given that struct foo could be written as:
struct foo
{
void * a;
bar bc;
};
In this case I would expect the same alignment, although I have a
niggling feeling that a DS9K machine may disagree.
You input would be appreciated.
Regards,
Darren
A while ago I posted a question about storage alignment (thread
"Calculating storage alignment") and your answers were very helpful,
so I was hoping you could help me out again.
My question is straighforward:
Given two structs,
struct foo
{
void * a;
unsigned b;
char c;
};
struct bar
{
unsigned b;
char c;
};
Is there any guarantee that the alignment of "c" in both structures,
relative to "b", will be the same?
I'd like to think "yes", given that struct foo could be written as:
struct foo
{
void * a;
bar bc;
};
In this case I would expect the same alignment, although I have a
niggling feeling that a DS9K machine may disagree.
You input would be appreciated.
Regards,
Darren