memory alignment within gcc structs

前端 未结 6 519
情歌与酒
情歌与酒 2020-11-29 05:38

I am porting an application to an ARM platform in C, the application also runs on an x86 processor, and must be backward compatible.

I am now having some issues with

6条回答
  •  不知归路
    2020-11-29 06:12

    As I am using linux, I have found that by echo 3 > /proc/cpu/alignment it will issue me with a warning, and fix the alignment issue. This is a work around but it is very helpful with locating where the structures are failing to be misaligned.

提交回复
热议问题