Warning as Error, but not all

前端 未结 2 1305
粉色の甜心
粉色の甜心 2021-01-05 16:35

I would like to enable Warning as Error on our current project/solution for obvious reasons.

There are several warnings that should NOT be handled as an error, eg Ob

相关标签:
2条回答
  • 2021-01-05 17:23

    It is possible in VS2005 assuming you are using C#.

    From http://blogs.msdn.com/kaevans/archive/2005/11/06/489681.aspx

    In Visual Studio 2005, you have a couple more options to control this. Now, you have 3 options for treating warnings as errors: All, None, or Specific Warnings, where you can provide a semi-colon separated list of error numbers.

    It is also possible to do it with GCC with the option -Werror=

    0 讨论(0)
  • 2021-01-05 17:32

    The warnaserror compiler option supports erroring only on specific warnings. You can thus specify all warnings to be shown as an error, then disable the errors for certain warnings. Using the page's example as a guide:

    /warnaserror
    /warnaserror-:642,649,652
    
    0 讨论(0)
提交回复
热议问题