In C# projects (.csproj
files), it is possible to treat all warnings as errors except a specific set of warnings. Typically, this makes sense for obsolete/deprecated warnings, as these are there specifically to not break a build while announcing an upcoming API change.
Is the same also possible somehow for C++/CLI projects, i.e. in .vcxproj
files?
(I am referring to seeing C4947 as a warning despite all other warnings being treated as errors.)
An answer from 2017 suggests it is not possible for plain C++ projects compiled by Microsoft's compiler by means of a compiler switch. However, I am hoping for the .vcxproj
Xml format to support some element that causes such a behaviour.
I have tried inserting the <WarningsNotAsErrors>4947</WarningsNotAsErrors>
element from the .csproj
file into the .vcxproj
file, but that won't help. Also, seeing that <TreatWarningsAsErrors>
from the .csproj
file is called <TreatWarningAsError>
in .vcxproj
(i.e. singular instead of plural), I tried <WarningNotAsError>4947</WarningNotAsError>
, but to no avail.
I have read somehints about treating only specific warnings as errors, but this, of course, is not a viable solution. There are hundreds, if not thousands, of warnings (possibly even more in future compiler versions), all of which I want to treat as errors, except for a single one.