From: Tim Hunter Date: 2003-09-11T08:30:39+09:00 Subject: Re: Calling fun taking struct and not pointer to struct? On Thu, 11 Sep 2003 04:24:05 +0900, Nathaniel Talbott wrote: > Tim Hunter [mailto:Tim.Hunter@sas.com] wrote: (...) >> You can't assume that "f" in OUTER2 is the same as "inner.a" in OUTER1. >> The compiler is free to align structure members, including "inner", any >> way it wants to, and the alignment requirements for "f" are certainly >> not the same as for "inner". If the compiler chooses, for example, to >> always align structures at dword boundaries, then there will be a >> word-sized gap between 'e' and 'inner.a' in the OUTER1 struct (assuming >> 32-bit machines) that may not appear between "e" and "f" in the OUTER2 >> struct. > > Hmmm... so the question is, is there any way to determine how the compiler > aligned things? > > > Nathaniel > > <:((>< Well, a starting point would be offsetof().