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.
相关问题
- Error building gcc 4.8.3 from source: libstdc++.so
- What are the recommended GNU linker options to spe
- What is the right order of linker flags in gcc?
- Why doesn't g++ -Wconversion warn about conver
- Where to get compiled version of gccxml on windows
相关文章
- Suppress “Circular dependency detected” suppress w
- gcc/g++ gives me error “CreateProcess: No such fil
- Calls that precede a function's definition can
- How can I use gcc's -I command to add recursiv
- How do I know if std::map insert succeeded or fail
- How to specify gcc flags (CXXFLAGS) particularly f
- How to force Delphi compiler to display all hints
- How to generate assembly code with gcc that can be
I found the trick. For library includes, instead of
-Idir
use-isystem dir
in the makefile. GCC then treats boost etc. as system includes and ignores any warnings from them.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.