0
#DEFINE LENGTH 4096

warning: ‘/name0’ directive output may be truncated writing 10 bytes into a region 
of size between 1 and 4096 [-Wformat-truncation=]
 snprintf(head_list->cname, LENGTH, "%s/name0", cpath);
                                       ^~~~~~~~~~

gcc 正在抛出这个警告。如何在不使用 -Wformat-truncation= 选项的情况下解决此问题?cpath 是一个 4096 大小的字符

4

0 回答 0