struct arp_hdr {
struct uip_eth_hdr ethhdr;
u16_t hwtype;
u16_t protocol;
u8_t hwlen;
u8_t protolen;
u16_t opcode;
struct uip_eth_addr shwaddr;
u16_t sipaddr[2];
struct uip_eth_addr dhwaddr;
u16_t dipaddr[2];
};
这里uip定义了一个嵌套的结构,另外有:#define BUF ((struct arp_hdr *)&uip_buf[0])
uip_buf是已经预先定义的un char类型的缓冲区,但是调试显示 sizeof(BUF-> ethhdr) 不等于14,我查了书,好象这是C语言中的边界不对齐问题,请问高手,我能否改变我的编译器设置就解决这个问题?谢谢!!