user1120381
user1120381

Reputation: 41

Vs2008: Disable warnings in included header files outside the project

Is it possible? I don't want to disable the warning globally as I want to check my own header files for warnings.

Upvotes: 4

Views: 630

Answers (1)

Fox32
Fox32

Reputation: 13560

You can disable warnings around the include of the external header file:

#pragma warning( push )
#pragma warning( disable: the warning)
 // include here
#pragma warning( pop )

If you need to include the header multiple times, you can create a header with the pragmas and include that instead. The same question was asked here.

Upvotes: 4

Related Questions