Is there a way to disable all warnings with a pragma?

前端 未结 4 1101
遇见更好的自我
遇见更好的自我 2020-12-14 05:44

I\'ve started a new project and have decided to make sure it builds cleanly with the /Wall option enabled. The only problem is not all 3rd party libraries (like boost) compi

4条回答
  •  感动是毒
    2020-12-14 06:26

    You can push/pop a low level of warning, like this:

    #pragma warning(push, 0)        
    
    #include 
    #include 
    // ...
    
    #pragma warning(pop)
    

    But know that it's not possible to disable all warnings. For example, some linker warnings are impossible to turn off.

提交回复
热议问题