How to suppress GCC warnings from library headers

gccgcc-warningsuppress-warningswarnings

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.

Best Answer

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.