3 回答

TA貢獻1856條經(jīng)驗 獲得超17個贊
__attribute__((__packed__))
#pragma pack(1)
-Wcast-align
-Wall
-Wextra
struct __attribute__((__packed__)) my_struct { char c; int i;};struct my_struct a = {'a', 123};struct my_struct *b = &a;int c = a.i;int d = b->i;int *e __attribute__((aligned(1))) = &a.i;int *f = &a.i;
a
b
a.i
c
d
int
a.i
b->i
, b
e
f = &a.i
-Wall
-Wextra
).

TA貢獻1829條經(jīng)驗 獲得超6個贊
.
->
- 3 回答
- 0 關(guān)注
- 1709 瀏覽
添加回答
舉報