https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96293

--- Comment #7 from lavr at ncbi dot nlm.nih.gov ---
The problem with the aligned(4) attribute is that if this structure appears as
a member of an outer packed structure, it may not be "enclosed" properly
without a gap.

The warnings are pointless is they are emitted for members that are located
already aligned to their native boundaries.  GCC is perfectly aware of all the
offsets and it so can only warn of those, which are indeed off.

Otherwise, it's the same if GCC begins warning about taking address of any
member, whose structure pointer was passed to a function, because that pointer
may not be assumed as properly aligned (any structure pointer passed to a
function is align(1) because the pointer's origin may not be generally even
known!).
But that'd be ridiculous!

Reply via email to