Quote from the link you provided:
Alignment of the aggregate fields does not affect the alignment of the aggregate itself - which is affected by the alignment setting outside the aggregate.
So, the second form aligns the structure fields. And the first aligns the structure.
In your example, consider a larger alignment - say, 16. The first form will lead to the following layout
TGAHeader.sizeof = 32 // the padding was added in the end of the struct TGAHeader.idLenght.offsetof = 0 TGAHeader.hasColormap.offsetof = 1 TGAHeader.imageType.offsetof = 2 TGAHeader.cmFirstEntry.offsetof = 4 TGAHeader.cmLength.offsetof = 6 TGAHeader.cmSize.offsetof = 8 TGAHeader.xOrigin.offsetof = 10 TGAHeader.yOrigin.offsetof = 12 TGAHeader.width.offsetof = 14 TGAHeader.height.offsetof = 16 TGAHeader.pixelDepth.offsetof = 18 TGAHeader.imageDescriptor.offsetof = 19
And the second form will result in
TGAHeader.sizeof = 192 // every field was padded TGAHeader.idLenght.offsetof = 0 TGAHeader.hasColormap.offsetof = 16 TGAHeader.imageType.offsetof = 32 TGAHeader.cmFirstEntry.offsetof = 48 TGAHeader.cmLength.offsetof = 64 TGAHeader.cmSize.offsetof = 80 TGAHeader.xOrigin.offsetof = 96 TGAHeader.yOrigin.offsetof = 112 TGAHeader.width.offsetof = 128 TGAHeader.height.offsetof = 144 TGAHeader.pixelDepth.offsetof = 160 TGAHeader.imageDescriptor.offsetof = 176
source share