How can I disable #pragma warnings?

I believe you can compile with

-Wno-unknown-pragmas

to suppress these.


In GCC, compile with -Wno-unknown-pragmas

In MS Visual Studio 2005 (this question isn't tagged with gcc, so I'm adding this for reference), you can disable globally in Project Settings->C/C++->Advanced. Enter 4068 in "Disable Specific Warnings"

or you can add this to any file to disable warnings locally

#pragma warning (disable : 4068 ) /* disable unknown pragma warnings */

Perhaps see GCC Diagnostic Pragmas? Alternatively in this case you could use the combination of options that -Wall enables, excluding -Wunknown-pragmas.