[Bug c/96293] Extraneously noisy "taking address of packed member may result in an unaligned pointer value"

lavr at ncbi dot nlm.nih.gov gcc-bugzilla@gcc.gnu.org
Thu Jul 23 14:59:50 GMT 2020


--- Comment #2 from lavr at ncbi dot nlm.nih.gov ---
I don't want my structure to be aligned at the int boundary.  I want my
structure to reflect the actual data layout "byte","byte","short","int" as they
are laid out without any gaps, and "packed" guarantees such a disposition.  I
also don't want GCC issue warnings "just in case" where there's nothing
happening: like I said the "short int" field is located at the native "short
int" offset (multiple of 20, so there's no need for the warning; and so on with
the int field.  GCC should worry only if, for example, an int is placed at an
odd offset, or, for 4 byte ints, at an offset not multiple of 4.

More information about the Gcc-bugs mailing list