PDA

View Full Version : Warning Suppression



lexfridman
21st May 2008, 16:06
I'm using qmake to generate the Makefile for my project. Compiler version is gcc 4.1.3. I turn all warnings on with -Wall and treat warnings as errors. My C++ project uses one class that wasn't written by me and I would like to suppress all the warnings from it. So as it is suggested, I add "#pragma GCC system_header" to the header file which defines the class. Below is the structure of the header file. The source foo.cpp file includes the header file with #include "foo.h". I still get basic warnings about contents of foo.cpp, like unused parameters, etc. Do you know what I could be doing wrong. As I said, here's the code:

#pragma GCC system_header // turn off all warnings

#ifndef _FOO_H_
#define _FOO_H_

... #includes

using namespace std;

class Foo { ... };
#endif