开发者

C++ Disabling warnings on a specific include

I'm won开发者_C百科dering if there's a way to disable all warnings on a specific file (for example, using a preprocessor directive).

I'm using CImg.h and I want to get rid of the warnings involving that code.

I'm compiling both with VS (the version for Windows) and gcc (the Linux one), so I would like to have a generic way...

Thanks!


You can do it using #pragma in Microsoft compiler:

http://msdn.microsoft.com/en-us/library/2c8f766e%28VS.80%29.aspx

Something like this:

#pragma warning (push, 0)

//....header file

#pragma warning (pop)

Can't help you with gcc compiler, some info here: Selectively disable GCC warnings for only part of a translation unit?

EDIT EDIT Try push, 0.


Look into #pragma warning.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜