[En-Nut-Discussion] ARM GCC 4.4 Alignment Problems

Harald Kipp harald.kipp at egnite.de
Thu Apr 1 12:27:08 CEST 2010


Hi all,

It looks like the optimizer changed in GCC 4.4.2, specifically access to
packed structure elements.

At several places we may have to change

struct __attribute__ ((packed))...

into

__attribute__ ((packed, __may_alias__))

In Nut/OS packed structures often refer to elements within other packed
structures. As far as I understood, the __may_alias__ attribute tells
the compiler that it should _not_ assume that the structure itself is
placed at an aligned address.


Harald



More information about the En-Nut-Discussion mailing list