5.7.12.8 Pack-struct Option

The -fpack-struct option packs all structure members together without padding bytes between them. Typically, this option is not used, since the structure members might become unaligned and the code required to access them becomes sub-optimal. Additionally, the offsets of members within such structures won’t agree with those for unpacked (aligned) structures in system libraries.

The -fno-pack-struct option chooses a structure arrangement that will produce optimal code, potentially placing padding bytes between members to ensure they are properly aligned for the device. This is the default action if no option is specified.