vs2003 警告等级问题

dba_1984 2009-09-15 04:01:14
关 : 关闭所有警告(/W0)
1 级(/W1)
2 级(/W2)
3 级(/W3)
4 级(/W4)
<从项目默认设置继承>

VS2003的警告等级有上面的几种,有几个不明白的地方请教下各位:
1、W0-W4 是数字越大,警告级别越高吗?
2、一般选用哪个等级的警告?
3、<从项目默认设置继承> 这个是什么意思?
...全文
256 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
af11060 2010-08-27
  • 打赏
  • 举报
回复
mark 学习下
fallening 2009-09-15
  • 打赏
  • 举报
回复
越高越好
wuyu637 2009-09-15
  • 打赏
  • 举报
回复
警告等级 含义

0


关闭所有警告消息的显示。

1


显示严重的警告消息。

2


显示等级 1 警告以及某些不太严重的警告,如关于隐藏类成员的警告。

这是命令行中的默认警告等级。

3


显示等级 2 警告以及某些不太严重的警告,如有关总是计算为真或假的表达式的警告。

4


显示所有等级 3 警告以及信息性警告。


===================
纠正一下,数字越大,警告级别越高。
xingzhe2001 2009-09-15
  • 打赏
  • 举报
回复
Specifies the highest level of warning generated by the compiler. Valid warning levels for n range from 0 to 4:

Level 0 disables all warnings.

Level 1 displays severe warnings. Level 1 is the default warning level at the command line.

Level 2 displays all level 1 warnings and warnings less severe than level 1.

Level 3 displays all level 2 warnings and all other warnings recommended for production purposes.

Level 4 displays all level 3 warnings plus informational warnings, which in most cases can be safely ignored. This option should be used only to provide "lint" level warnings and is not recommended as your usual warning level setting.

For a new project, it may be best to use /W4 in all compilations. This will ensure the fewest possible hard-to-find code defects.
wuyu637 2009-09-15
  • 打赏
  • 举报
回复
1. 刚好相反,数字越大,警告等级越低。
2. 一般选默认的W3
3. http://msdn.microsoft.com/zh-cn/library/3z7t21ew(VS.80).aspx
「已注销」 2009-09-15
  • 打赏
  • 举报
回复
1.是的
2.W3(默认)
3.根据加载进来的项目级别来定
「已注销」 2009-09-15
  • 打赏
  • 举报
回复
1.使得
2.W3(默认)
3.根据加载进来的项目级别来定
xingzhe2001 2009-09-15
  • 打赏
  • 举报
回复
1.你说得对
2.平时随便,发布的时候/W4
3.就是说继承自sln的设置

64,701

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧