472,374 Members | 1,267 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 software developers and data experts.

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 2226
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Efy. | last post by:
Hello, The following problam description I did not need to write, I just copied from the groups from others which met the error and allways the thread was 1 artical the problem was never...
2
by: Charles L | last post by:
I am trying to find a link to the 'C++ Annotations' by Frank Brokken (I think Version 5.2.4 is the latest) that works because I've been unable to find one that does. Can anyone suggest anything? ...
0
by: Charles L | last post by:
Does anyone know if there is any Errata for 'C++ Annotations' by Brokken? Charles Leng
1
by: Moon | last post by:
Well, this is my first attempt at DHTML so I'm asking for some pointers, hopefully in the right groups, follow-up is set. I'm currently working on another translation of an english text and I'd...
1
by: Jonathan Gibbs | last post by:
I'm very new to xml, and struggling a bit.. I want to use an .xsd file passed to a windows application to define a dataset's schema, and also (if possible) pass other metadata associated with...
1
by: Egbert Nierop \(MVP for IIS\) | last post by:
Are they really making any impact on produced code? for instance if you look at the code below, in assembly it does not produce any check. And if you set an annotation on them, it should...
8
by: oripel | last post by:
Hi, I'm trying to attach some attributes to functions and methods, similar to Java annotations and .NET attributes. I also want to use a convenient decorator for it, something along the lines...
4
by: Tony Lownds | last post by:
(Note: PEPs in the 3xxx number range are intended for Python 3000) PEP: 3107 Title: Function Annotations Version: $Revision: 53169 $ Last-Modified: $Date: 2006-12-27 20:59:16 -0800 (Wed, 27 Dec...
3
by: Sektor van Skijlen | last post by:
Is there any official proposal for annotations in C++0x? So far annotations have been "implicitly" used in many proposals as some (usually) free-form text enclosed in ] (for example, n2493,...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.