469,921 Members | 2,198 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,921 developers. It's quick & easy.

SAL annotations - how they work?

How the code annotations ( __in_opt, __out, __checkReturn ... ) are supposed
to work ?
Are they part of the new MS C language (that's, real tokens understood by
the compiler), or always #define'd as nothing and interpreted by some
external tools?

Regards,
--PA

Nov 17 '05 #1
6 2146
Hi Pavel!
How the code annotations ( __in_opt, __out, __checkReturn ... ) are supposed
to work ?
Are they part of the new MS C language (that's, real tokens understood by
the compiler), or always #define'd as nothing and interpreted by some
external tools?


In VC8 it is understood by the compiler and it can be checked if you
specify the /analyze switch.

See: /analyze
http://msdn2.microsoft.com/library/m...us,vs.80).aspx

For more info see:

See: Header Annotations
http://msdn.microsoft.com/library/en...nnotations.asp

See: Code Analysis for C/C++ Overview
http://msdn2.microsoft.com/library/d...us,vs.80).aspx

See: Using Annotations to Reduce C/C++ Code Defects
http://msdn2.microsoft.com/library/m...us,vs.80).aspx
Of course... the documentation is currently not very good...

In the DDK this method is used at least for more than 1-2 years (called
FxCop).

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Nov 17 '05 #2
Jochen Kalmbach [MVP] wrote:
In the DDK this method is used at least for more than 1-2 years
(called FxCop).


Make that Prefast - FxCop is the CLR static analysis tool.

-cd
Nov 17 '05 #3
Hi Carl!
In the DDK this method is used at least for more than 1-2 years
(called FxCop).


Make that Prefast - FxCop is the CLR static analysis tool.


Upps... sorry.. I mixed it up...

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Nov 17 '05 #4
I've checked the current DDK (3790.1830) and found only
one copy of specstrings.h in inc\crt.
All these symbols defined there as nothing, so it isn't clear
how this is supposed to work.

As I understand, existing macros IN, OUT OPTIONAL are totally deprecated
because new compiler has more explicit conditions.
IN and OUT could be redefined as __in, __out, but OPTIONAL has no direct
match.

--PA

Nov 17 '05 #5
Hi Pavel!
I've checked the current DDK (3790.1830) and found only
one copy of specstrings.h in inc\crt.
All these symbols defined there as nothing, so it isn't clear
how this is supposed to work.


It seems that the DDK-Prefast only does "smart-codepath-checking".

See: PREfast Step-by-Step
http://www.microsoft.com/whdc/DevToo...ast_steps.mspx

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Nov 17 '05 #6
Thanks. Didn't know that you are interested in the DDK stuff.
--PA

"Jochen Kalmbach [MVP]" <no********************@holzma.de> wrote in message news:e7**************@TK2MSFTNGP15.phx.gbl...
Hi Pavel!
I've checked the current DDK (3790.1830) and found only one copy of specstrings.h in inc\crt.
All these symbols defined there as nothing, so it isn't clear how this is supposed to work.


It seems that the DDK-Prefast only does "smart-codepath-checking".

See: PREfast Step-by-Step
http://www.microsoft.com/whdc/DevToo...ast_steps.mspx

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/

Nov 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Charles L | last post: by
1 post views Thread by Jonathan Gibbs | last post: by
1 post views Thread by Egbert Nierop \(MVP for IIS\) | last post: by
4 posts views Thread by Tony Lownds | last post: by
3 posts views Thread by Sektor van Skijlen | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.