关 : 关闭所有警告(/W0) : 关闭所有警告消息的显示。
1 级(/W1) : 显示严重的警告消息。
2 级(/W2) : 显示等级 1 警告以及某些不太严重的警告,如关于隐藏类成员的警告。这是命令行中的默认警告等级。
3 级(/W3) : 显示等级 2 警告以及某些不太严重的警告,如有关总是计算为真或假的表达式的警告。
4 级(/W4) : 显示所有等级 3 警告以及信息性警告。
vs默认等级为/W3, 调试时不想出太多警告信息可以设为/W1,比如不想看见“使用未初始化的变量”警告信息刷屏, 发布时最好设为/W4.
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.
http://bbs.csdn.net/topics/320032462