低版本gcc编译正常,高版本编译以下代码出警告是什么原因。
struct{
uint8_t a_file_name[255];
}
char di_cmd[256];
sprintf(di_cmd,"rm -rf./%s",
(char*)di_mk_file_name.a_file_name);
警告:'%s' directive writing up to 254 bytes into a region of size 248
备考:'sprintf' output between 9 and 263 byte into a destination of size 256