7

In the answer to this question, gcc treat all warnings as errors EXCEPT X it is shown how all warnings can be treated as errors except one.

First we add the compiler flag that treats all warnings as errors:

-Werror

Then we add exceptions to the above rule (in this case error called deprecated)

-Wno-error=deprecated

Is there a similar method in Microsoft Visual C++?

Community
  • 1
  • 1
Alexandru Irimiea
  • 2,513
  • 4
  • 26
  • 46
  • 1
    There's `/wd` for disabling a particular warning. I don't believe there's a switch to undo `/WX` for a specific warning (that is, still issue it, but as a warning rather than an error). – Igor Tandetnik Mar 18 '17 at 22:22

1 Answers1

3

No.

There was a user suggestion to add such a feature to Visual C++, but the item was closed by the Visual Studio Team (https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/2597342-extend-c-to-treat-all-warnings-as-errors-except).

You can just treat specific warnings as errors: Can I treat a specific warning as an error?

Community
  • 1
  • 1
inabout
  • 311
  • 2
  • 6