http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57648
Richard Earnshaw <rearnsha at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #2 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
static uint8_t source[sizeof(TestStruct) + 4] __attribute__((aligned(4)));
...
// create a half-word aligned structure (fails!)
TestStruct * sourcePtrFail = (TestStruct *) &(source[2]);
This has undefined behaviour. Your TestStruct defintion is required (by the
ABI) to have word alignment.