Is using #pragma warning push/pop the right way to temporarily alter warning level?

后端 未结 7 1590
别跟我提以往
别跟我提以往 2020-11-28 04:00

Once in a while it\'s difficult to write C++ code that wouldn\'t emit warnings at all. Having warnings enabled is however a good idea. So it is often necessary to disable wa

7条回答
  •  不知归路
    2020-11-28 04:16

    You can disable specific warnings in the project or file options and this setting applies as the 'default' per those #pragmas at the relevant scope. Some of the warnings in VS2005 are so useless/annoying that this cleans up the output quite a bit, if using /W4.

    This is in Properties under Configuration Properties -> C/C++ -> Advanced.

提交回复
热议问题