Sample Program for Code Analysis Tool

Tech-Archive recommends: Fix windows errors by optimizing your registry



This may not be the right forum, but let me start here. (Gently inform me if
there is a better place.)

I'm trying to test/evaluate the code analysis features of the Visual Studio
8 Team Edition and following the documentation to get started. Microsoft's
Demo Sample provided in the documentation does not build as indicated. Am I
doing something wrong?


Here is where I am in the documentation:
Development Tools and Languages
Visual Studio Team System
Writing Quality Code
Detecting and Correcting C/C++ Code Defects
Walkthrough: Analyzing C/C++ Code Defects
(The Sample Demo is downloadable from this page)

The paragraph that talks about building the Annotations project starts with

"To Correct the source code annotation warnings in annotation.c"

It says I should get the following error when I build:

warning C6011: Dereferencing NULL pointer 'newNode'.


I do not. I get this error:


error C3115: 'PostAttribute': this attribute is not allowed on 'AllocateNode'
1> c:\program files (x86)\microsoft visual studio
8\vc\include\codeanalysis\sourceannotations.h(81) : see declaration of
'PostAttribute'
1> attribute can only be applied to: 'parameters', 'return values'

I tried commenting out the SA_Post stuff in annotations.h, and it will
build. However, that was the stuff the demo was trying to illustrate. I went
on to the next steps and tried adding

"[SA_Post (Null=SA_Maybe)] LinkedList* AddTail

(

[SA_Pre(Null=SA_Maybe)] LinkedList* node,

int value

)"

as the doc instructs.

This also results in the same type of error:

error C3115: 'PostAttribute': this attribute is not allowed on 'AddTail'

Does this feature really work or am I doing something wrong?

Thanks,
Beth









.