This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc structures


On 09/09/2013 09:57 AM, David Brown wrote:
> I'm not even sure if it is
> required to keep the struct elements in the same order

It is.  6.7.2.1:

    Each non-bit-field member of a structure or union object is
    aligned in an implementation-defined manner appropriate to its
    type. Within a structure object, the non-bit-field members and the
    units in which bit-fields reside have addresses that increase in
    the order in which they are declared.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]