Wednesday, January 27, 2010

How to Disable Code Analysis on 3rd Party Headers

This little snippet will disable the code analysis features of Visual C++ on header files that, for whatever reason, you can not edit or fix. This does include some Windows header files (especially ATL).

#include <codeanalysis/warnings.h>

#pragma warning (push)
#pragma warning (disable: ALL_CODE_ANALYSIS_WARNINGS)

// include 3rd party headers here

#pragma warning (pop)

I know this is in MSDN, but it’s easier to search this blog than MSDN!

I have chosen Pygments for my source code formatting. It is a Python library that handles many languages. It is the best (of about 10 or so) that I have tried by far. I am very impressed.

No comments:

Post a Comment