gcc/g++ disable warnings in particular include files

当在编译一个大项目的时候,你想打开所有的Warning,但是打开后发现一堆公共库文件都出现了warning报错。此时如果你想忽略公共库头文件中的warning报错,只需要在编译的时候,将公共库头文件的指定方式由-I改为-isystem即可:

gcc -Iparent/path/of/bar 

to

gcc -isystem parent/path/of/bar 

附gcc的所有warning选项:https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
posted @ 2017-10-10 14:42  CobbLiu  阅读(460)  评论(0编辑  收藏  举报