c++unit-testingvisual-studio-2012compiler-warningsvisual-leak-detector

Warning message printed to console not failing the build


I have warnings as errors turned on and the warning level cranked up to the max. I've integrated VLD in my unit tests. When I purposefully create memory leaks, VLD prints a warning in the Visual Studio output console and the warnings console.

The warning is formatted like warning : Visual Leak Detector detected memory leaks!

However, Visual Studio reports that the build succeeds. Is warnings as errors limited to Visual Studio generated warnings?


Solution

  • Yes, the "warnings are errors" is a compiler setting, which basically says "If (error_level == warning) error_level = error;" inside the compiler.