在visual studio中启用单个警告 [英] Enable a single warning in visual studio

查看:178
本文介绍了在visual studio中启用单个警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有编译器开关在visual studio中启用单个警告?

Is there a compiler switch to enable a single warning in visual studio?

我问的原因是我想启用警告C4265,它默认关闭。

The reason I ask is I want to enable warning C4265 which is off by default. My searching has only turned up ways to turn warnings off.

即使是MS页面,也称为如何:启用或禁用编译器警告仍然只提到禁用。

Even MS pages called How to: Enable or Disable Compiler Warnings still only mention disabling.

推荐答案

您要在项目设置中将其打开(或关闭),您必须转到:

If you want to turn it on (or off) in the project setting, you have to go to:

配置属性 - > C / C ++ - >命令行,然后在其他选项下输入:

/ w3 ## ## 将警告设置为3级,从而启用它;或者可以输入 / wd #### 以禁用警告。

/w3#### to set your warning to level 3, and thus enable it; or you can enter /wd#### to disable a warning.

这篇关于在visual studio中启用单个警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆