I have just started working with C++ code compiled in Visual Studio 2008. The default warning level on the project was set to 3 and there were no warnings. I turned this up to level 4, and it turns out that there are about 35000 warnings in our code. The majority of these warnings are unreferenced formal parameters, which I’d like to remove eventually.
In the meantime, I would like to make sure that any level 3 or lower warnings stand out from the crowd, so I was wondering if there was a way of making these particular warnings be treated as errors. I’m aware that specific warnings can be tagged as errors, but I can’t find any listings for error numbers.
I was wondering if anybody might have any suggestions about how to deal with this?
You could make two separate build configurations, one showing warnings level 3, and one shows level 4 as well. Then when you’re not working on fixing warnings, use the level 3 configuration. If you do go down this route, you might want to look into using property sheets, so you can reuse as much as possible of the configuration, instead of having to duplicate it.
I don’t think there’s any way to treat warnings L1-3 as errors, while still allowing/showing L4 warnings.