#define PRINT_ERR(format,...) {fprintf(stderr, "[%s:%s:%d] "format"\n", __FILE__, __func__, __LINE__, ##__VA_ARGS__);}
在编译的过程中报错
storage.h:18:67: error: unable to find string literal operator ‘operator""format’ with ‘const char [13]’, ‘long unsigned int’ arguments
#define PRINT_ERR(format,...) {fprintf(stderr, "[%s:%s:%d] "format"\n", __FILE__, __func__, __LINE__, ##__VA_ARGS__);}
备注:直接这样在C语言中是可以编译通过的,C++的要求是,当字符串跟变量连接的时候,必须format前后增加一个空格才行
#define PRINT_ERR(format,...) {fprintf(stderr, "[%s:%s:%d] " format"\n", __FILE__, __func__, __LINE__, ##__VA_ARGS__);}