I frequently use code like this:
struct teststruct
{
uint8_t i1;
uint16_t i2;
uint32_t i4;
} __attribute__((__packed__));
struct teststruct *protocol = (struct teststruct *)buffer;
uint16_t var = protocol->i2;
In order to access protocol data via structs.
The code works for AVR gcc 4.6, 4.7 and Win32 4.6, 4.7 and Linux 4.6 However now from (MingW) gcc 4.8 it does not work as expected. sizeof(struct teststruct) will return 8.
I did not found any hints why it does not work anymore. Or is there an other way to access a protocol buffer a structural way?