标签:fun [] bsp 使用 span color warnings col test
1.禁止隐式声明
-Werror=implicit-function-declaration 编译选项中加了这个,隐式声明不过,报error而不是warning了
eg: test.c int main(int argc, char *argv[]) { char *pstr = "hello nihao"; printf("l pstr=%s\n", pstr); } [ubuntu @tmp]$ gcc test.c -o pp test.c: In function ‘main’: test.c:5:2: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default] printf("l pstr=%s\n", pstr); [ubuntu @tmp]$ gcc test.c -Werror=implicit-function-declaration -o pp test.c: In function ‘main’: test.c:5:2: error: implicit declaration of function ‘printf’ [-Werror=implicit-function-declaration] printf("l pstr=%s\n", pstr); ^ test.c:5:2: warning: incompatible implicit declaration of built-in function ‘printf’ [enabled by default] cc1: some warnings being treated as errors
标签:fun [] bsp 使用 span color warnings col test
原文地址:https://www.cnblogs.com/hellokitty2/p/9096272.html