microsoft-sal

What is the purpose of SAL (Source Annotation Language) and what is the difference between SAL 1 and 2?

ⅰ亾dé卋堺 提交于 2019-12-06 02:03:46
问题 As asked in the title: What is the purpose of SAL (Source Annotation Language) and what is the difference between SAL 1 and SAL 2? I understand the basics of the usage, and that is serves to highlight the purpose of each of the variables passed to functions along with various other things for static code analysis, but how much difference does it actually make (ignoring increasing clarity of parameter requirements for other programmers on the project)? If I was to have the following prototype:

What is the purpose of SAL (Source Annotation Language) and what is the difference between SAL 1 and 2?

两盒软妹~` 提交于 2019-12-04 05:21:32
As asked in the title: What is the purpose of SAL (Source Annotation Language) and what is the difference between SAL 1 and SAL 2? I understand the basics of the usage, and that is serves to highlight the purpose of each of the variables passed to functions along with various other things for static code analysis, but how much difference does it actually make (ignoring increasing clarity of parameter requirements for other programmers on the project)? If I was to have the following prototype: _Success_(return == 1) int TestFunction( _In_ int* pTest, _Inopt_ char* pOptional ); This is supposed

Meaning of __in , __out, __in_opt

夙愿已清 提交于 2019-11-28 07:55:36
问题 What is the meaning of these keywords used before variables in a function parameters? __in __out __in_opt 回答1: Those are some of the older decoration macro's from Microsoft's SAL Annotations (the newer ones now follow different casing, starting with a capital). These have no real affect on compilation (under VS 2010 they aren't even expanded), they are there for inline API documentation. __in : this parameter is an input to the function (read-only, caller initialized). __out : this parameter