本文主要是介绍Windows下的编译选项:/WX, /wd,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
原文:http://msdn.microsoft.com/en-us/library/thxezb7y.aspx
Option | Description |
---|---|
/w | Disables all compiler warnings. |
/W n | Specifies the highest level of warning generated by the compiler. Valid warning levels for n range from 0 to 4:
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. |
/Wall | Enables all warnings, including those disabled by default. See Compiler Warnings That Are Off By Default. |
/WX | Treats all compiler warnings as errors. For a new project, it may be best to use /WX in all compilations; resolving all warnings will ensure the fewest possible hard-to-find code defects. The linker also has a /WX option; see /WX (Treat Linker Warnings as Errors) for more information. |
/w ln | Specifies the level for a particular warning. The first parameter sets the warning level (same as /Wn) and the second parameter is the actual warning number. For example, /w14326 causes C4326 to be generated as a level 1 warning. |
/wd n | Disables the specified compiler warning where nis the compiler warning number. For example, /wd4326 disables compiler warning C4326. |
/we n | Treats the specific compiler warning as an error where n is a compiler warning. For example, /we4326 flags warning number C4326 as an error. |
/wo n | Reports the error only once where n is a compiler warning. For example, /wo4326 will cause warning C4326 to be reported only once. |
这篇关于Windows下的编译选项:/WX, /wd的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!