如何从库头压缩GCC警告? [英] How to suppress GCC warnings from library headers?
本文介绍了如何从库头压缩GCC警告?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个使用log4cxx,boost等库的项目,这些库的头文件会生成很多(重复)警告。有没有办法从库中包含警告(即#include
-I
。这将使他们成为系统标题,GCC不会为他们报告警告。 I have a project that uses log4cxx, boost, etc. libraries whose headers generate lots of (repetitive) warnings. Is there a way to suppress warnings from library includes (i.e. #include <some-header.h>) or includes from certain paths? I'd like to use -Wall and/or -Wextra as usual on project code without relevant info being obscured. I currently use grep on make output but I'd like something better.
解决方案
You may try to include library headers using -isystem
instead of -I
. This will make them "system headers" and GCC won't report warnings for them.
这篇关于如何从库头压缩GCC警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文