This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F280039C: 如何取消结构体字节对齐

Part Number: TMS320F280039C

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
typedef struct
{
float a;
float b;
int c;
float d;
float e;
int f;
int g;
Uint16 h;
float i;
float j;
int k;
int l;
float m;
float n;
float o;
int p;
int q;
}Test_dat_strut1;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
这是我用来测试的结构体,我在仿真中观察到变量c占了32位,我试过在结构体定义时加入__attribute__((packed))和#pragma pack(1)命令,但都不起作用,由于这个结构体要在通讯中用到,我该如何取消结构体对齐