I link my C++ code against several libraries (a couple of which are heavily header-based), some of which haven't been updated in a while. I've been compiling my code with -Wall
and Wextra
on GCC 4.0 for a while with no warnings or errors. However, now that I'm using a newer version of GCC (4.3), a number of my files have been printing warnings from the other libraries' include files (e.g., warning: type qualifiers ignored on function return type
when the library's templated code uses the restrict
keyword on a returned pointer). Similarly, one of the slightly older versions of OpenMPI on a cluster that I'm using prints out many warnings when compiled with GCC 4.1.
The question is: Can I do anything to disable warnings just inside other peoples' code, when leaving a local directory to read a header file? I want to make my code as clean and correct as possible (hence, I enable all warnings), but the purpose is defeated if my make process is cluttered up by problems that I'm unable to fix. Will I just have to globally disable specific warnings that crop up in their code?