报错:warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wli

C++程序编译报错:

文字上的无效后缀; C ++ 11需要文字和标识符之间的空格”

警告信息:

./src/../include/base.h:14:32: warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]
 #define pri(fmt, ...)  printf( " ["__FILE__"] [%s] %d " ,__FUNCTION__,__LINE__ );\

需要在 “_FUNCTION_” 前后留出空格:

#define pri(fmt, ...) 	printf("[" __FILE__ "] [%s] %d ",__FUNCTION__,__LINE__ );\
						printf(fmt, ##__VA_ARGS__);

参考链接:
https://github.com/konstantinmiller/dashp2p/issues/3

你可能感兴趣的:(C/C++,Errors)