This is a mirror of official site: http://jasper-net.blogspot.com/

Elucidating all about Code Analysis in Visual C++

| Sunday, November 14, 2010
Introduction

Every professional C++ programmer knows about the complexity levels of C++ programs, about the deeply buried bugs in code and difficult approach to find and resolve them. Even after compiling the code with highest warning levels, few bugs remain persistent in code. Thus, the need for a tool that can analyze the code in heuristic manner, i.e. by intelligently looking at surrounding code to find potential bugs, becomes indispensable.

While there are umpteen number of free and paid tools available for the Code Analysis, for different platforms and compilers, I would elucidate the Code Analysis feature that is available with Visual Studio 2005/2008/2010. Unfortunately, this feature is only available on Team System, and ultimate versions of Visual Studio.

This article is broadly divided into three logical categories, as listed below.

The need of Code Analysis
Performing Code Analysis on your code
Making your own code Analyzable
Sample code and few screen shots would be given as we move further, thus reader must understand the code carefully. The following Visual Studio versions have been used, there are some inconsistencies between them, that I would list as they come into discussion.

Visual Studio 2005 SP1 - Team Suite, with Vista Update.
Visual Studio 2008 - Team System, RTM
Visual Studio 2010 Ultimate
The need of Code Analysis

Let's have a slightly buggy code that can be easily detected by human, the standard compiler (hence forth, only compiler), and by the Code Analysis tool.

Read more: Codeproject

Posted via email from .NET Info

0 comments: