zoukankan      html  css  js  c++  java
  • pragma warning push[.n] / pop [from msdn]

    Push and Pop

    The warning pragma also supports the following syntax.

    #pragma warning( push [ ,n ] )

    #pragma warning( pop )

    Where n represents a warning level (1 through 4).

    The pragma warning( push ) stores the current warning state for every warning. The pragma warning( push, n) stores the current state for every warning and sets the global warning level to n.

    The pragma warning( pop ) pops the last warning state pushed onto the stack. Any changes that you made to the warning state between push and pop are undone. Consider this example:

    #pragma warning( push )
    #pragma warning( disable : 4705 )
    #pragma warning( disable : 4706 )
    #pragma warning( disable : 4707 )
    // Some code
    #pragma warning( pop ) 
    

    At the end of this code, pop restores the state of every warning (includes 4705, 4706, and 4707) to what it was at the start of the code.

    When you write header files, you can use push and pop to guarantee that warning-state changes made by a user do not prevent the headers from compiling correctly. Use push at the start of the header and pop at the end. For example, if you have a header that does not compile cleanly at warning level 4, the following code would change the warning level to 3 and then restore the original warning level at the end of the header.

    #pragma warning( push, 3 )
    // Declarations/definitions
    #pragma warning( pop ) 
     
    即保存及恢复当前warning们的状态
     
    Ref: http://msdn.microsoft.com/en-us/library/2c8f766e.aspx
  • 相关阅读:
    Android消息的提示,Toast吐司方式
    Java内部类
    Android环境配置及运行helloWord案例
    翻译Android API Guides: App Manifest
    Android Configuration介绍 (未完成)
    jquery之效果操作
    jquery之属性操作
    JQuery之dom文档操作
    jQuery之css操作
    jQuery选择器的优点
  • 原文地址:https://www.cnblogs.com/justin_s/p/2299370.html
Copyright © 2011-2022 走看看