我在 C 中编译时收到以下警告。
../tcpuip/uip_arp.c: In function 'display_arp_table':
../tcpuip/uip_arp.c:547: warning: '0' flag ignored with precision and '%x' gnu_p
rintf format
../tcpuip/uip_arp.c:547: warning: '0' flag ignored with precision and '%x' gnu_p
rintf format
../tcpuip/uip_arp.c:547: warning: '0' flag ignored with precision and '%x' gnu_p
rintf format
../tcpuip/uip_arp.c:547: warning: '0' flag ignored with precision and '%x' gnu_p
rintf format
../tcpuip/uip_arp.c:547: warning: '0' flag ignored with precision and '%x' gnu_p
rintf format
../tcpuip/uip_arp.c:547: warning: '0' flag ignored with precision and '%x' gnu_p
rintf format
../tcpuip/uip_arp.c:547: warning: '0' flag ignored with precision and '%x' gnu_p
rintf format
../tcpuip/uip_arp.c:547: warning: '0' flag ignored with precision and '%x' gnu_p
rintf format
../tcpuip/uip_arp.c:547: warning: '0' flag ignored with precision and '%x' gnu_p
rintf format
../tcpuip/uip_arp.c:547: warning: '0' flag ignored with precision and '%x' gnu_p
rintf format
../tcpuip/uip_arp.c:547: warning: '0' flag ignored with precision and '%x' gnu_p
rintf format
../tcpuip/uip_arp.c:547: warning: '0' flag ignored with precision and '%x' gnu_printf format
错误所在的行是
RELEASE_MSG("MAC: %0.2x.%0.2x.%0.2x.%0.2x.%0.2x.%0.2x ",(unsigned char)tabptr->ethaddr.addr[0],(unsigned char)tabptr->ethaddr.addr[1],(unsigned char)tabptr->ethaddr.addr[2],(unsigned char)tabptr->ethaddr.addr[3],(unsigned char)tabptr->ethaddr.addr[4],(unsigned char)tabptr->ethaddr.addr[5]);
tabptr 是 struct arp_entry 的指针
PACKED struct arp_entry {
u16_t ipaddr[2];
struct uip_eth_addr ethaddr;
u8_t time;
#ifdef _ALIGNED_
u8_t dummy;
#endif
}
ethadder 是 struct uip_eth_addr 的指针
PACKED struct uip_eth_addr {
u8_t addr[6];
} ;
请如果有人可以分享一些关于这个警告的信息。我只知道 %0.2x 表示字符为两位数十六进制。帮助!