Struct packing and alignment with mingw

后端 未结 3 1326
别那么骄傲
别那么骄傲 2021-01-12 18:40

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

3条回答
  •  余生分开走
    2021-01-12 19:28

    I fixed it by myself -> Compiling with -mno-ms-bitfields helps! The code above is indeed correct. It is necessary to tell mingw to use gcc's bitfield organisation instead of the microsoft style. Though the code can be uncompileable with microsoft compilers then, I do not care at this point.

提交回复
热议问题