1. 程式人生 > >VS警告等級W0

VS警告等級W0

關 : 關閉所有警告(/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.

這裡寫圖片描述