0

I want to treat a specific warning as an error, and I want to configure that in Visual Studio (2019 in particular). From this question or this MSDN page I know it must be possible. I just con't figure out how to do it in Visual Studio.

My project is a C++ project and I'm in the project settings under C++ / Advanced. There is a field called "Treat Specific Warnings As Error", which has an "Edit" functionality. But what do I enter there?

  • The compiler warning as I get it from the build output: C4390.
  • The compiler switch: /We4390

Treat Specific Warnings As Errors dialog

No matter what I do, when I have a look at the complete command line, there is no compiler switch for that warning.

Thomas Weller
  • 55,411
  • 20
  • 125
  • 222

1 Answers1

1

Enter the numbers only, i.e. 4390. For multiple warnings, enter them semicolon separated: 4390;4391.

If you don't see it in the command line, click the "Apply" button.

In the command line, they will appear as /We"...".

JHBonarius
  • 10,824
  • 3
  • 22
  • 41
Thomas Weller
  • 55,411
  • 20
  • 125
  • 222