I am emulating code from an embedded system (stm32, Keil µVision 5, MDK-ARM) on a PC (mingw32, 32bit arch). The alignment of the ARM compiler does not match my desktop m
attribute packed is broken on mingw32 compilers. Another option is to use pragma pack:
#pragma pack(1) typedef struct _file { uint8_t var1; uint16_t var2; } FILE;