Re: [PATCH 1/9] Define a structure for object IDs.
- From
Andreas Schwab <schwab@linux-m68k.org>
- Date
- May 4, 2014, 10:55 UTC
- Message-ID
- <m2mwexke34.fsf@linux-m68k.org>
- In-Reply-To
- <536606AB.1020803@kdbg.org>
Johannes Sixt <j6t@kdbg.org> writes:
> I think that a compiler that has different size and alignment requirements > for the proposed struct object_id and an unsigned char[20] would, strictly > speaking, not be a "C" compiler.
Unlike arrays, a struct can have arbitrary internal padding. It is perfectly compliant (and even reasonable) to make struct object_id require 8 byte alignment, adding 4 bytes of padding at the end.
Andreas.
-- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."