VS下的 SAL

SAL = source-code annotation language

可以用来帮助程序员标记函数的参数的一些性质,并且可以利用编译器进行代码静态分析,提高可读性。

When Do I Annotate?

Here are some guidelines:

  • Annotate all pointer parameters.

  • Annotate value-range annotations so that Code Analysis can ensure buffer and pointer safety.

  • Annotate locking rules and locking side effects. For more information, see Annotating Locking Behavior.

  • Annotate driver properties and other domain-specific properties.

Or you can annotate all parameters to make your intent clear throughout and to make it easy to check that annotations have been done.


你可能感兴趣的:(VS下的 SAL)