howto filter Visual Studio Debug Output
I have a bunch of warnings (over 10000) in my debug output which can be savely ignored: Warning: CFile::GetStatus() returns m_attribute without high-order flags
Is it possible to write a f开发者_运维百科ilter for this window?
In Visual Studio 2005, you can filter specific warning codes for your project outside of your code. Bring up the project's properties dialog and go to Configuration Properties -> C/C++ -> Advanced. You should see a "Disable Specific Warnings" setting. Click on that and add the warning codes you want to filter. If the warning is C4996, for example, just enter 4996 without the C.
However, I don't think this method will work with warnings that have no code associated with them.
Newer versions of Visual Studio likely provide something along the same lines.
Disable it in the code:
#pragma warning( push )
#pragma warning( disable : nnnn )
#include "nasty.h"
#pragma warning( pop )
where nnnn
is the warning's number (or a comma-separated list of such numbers).
精彩评论