How to eliminate external lib/third party warnings in GCC

Michael picture Michael · Jul 22, 2010 · Viewed 9.7k times · Source

In the software project I'm working on, we use certain 3rd party libraries which, sadly, produce annoying gcc warnings. We are striving to clean all code of warnings, and want to enable the treat-warnings-as-errors (-Werror) flag in GCC. Is there a way to make these 3rd party generated warnings, which we cannot fix, to disappear?

Answer

ImmortalPC picture ImmortalPC · Jul 26, 2012

Use -isystem Example:

gcc -I./src/ -isystem /usr/include/boost/ -c file.c -o obj/file.o

With -isystem NO warning about boost :D