虽然警告没什么关系,吾能去掉的都尽量去掉。比如以下代码编译有警告:
printf("responsed %u:%s\n", strlen(response), response); gh_http.c:288:12: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 2 has type ‘size_t {aka long unsigned int}’ [-Wformat=] printf("responsed %u:%s\n",strlen(response),response);
怎么解决?改为%zu即可。
printf("responsed %zu:%s\n", strlen(response), response);