Warning as an error, but not all

I want to include Warning as Error in our current project / solution for obvious reasons.

There are several warnings that should NOT be handled as errors, such as Deprecated and the use of the #warning directives.

Is it possible?

I see that I can lead specific warnings to errors, but I would really like them to be inverted.

The closest I can get is to disable the 2 above warnings, but there will be no “warnings” for them.

Any suggestions?

To clarify:

I need warnings, not as an error. Thus, all warnings except the aforementioned exceptions will behave like an error, and the aforementioned ones will be warnings (which I see in the compiler results).

+5
source share
2 answers

The parameter warnaserrorsupports errors only with certain warnings. Thus, you can specify all warnings that will be displayed as an error, and then disable errors for certain warnings. Using the sample page as a guide:

/warnaserror
/warnaserror-:642,649,652
+5
source

In VS2005, you can assume that 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. You now have 3 options for treating warnings as errors: All, None, or Specific warnings, where you can provide a comma-separated list of error numbers.

GCC -Werror =

0

All Articles