Using SAL Annotations to Reduce C/C++ Code Defects
SAL is the Microsoft source code annotation language. By using source code annotations, you can make the intent behind your code explicit. These annotations also enable automated static analysis tools to analyze your code more accurately, with significantly fewer false positives and false negatives.
The articles in this section of the documentation discuss aspects of SAL, provide reference for SAL syntax, and give examples of its use.
-
Provides information and examples that show the core SAL annotations.
Annotating Function Parameters and Return Values
Lists the SAL annotations for functions and function parameters.
-
Lists the SAL annotations for functions and function behavior.
Annotating Structs and Classes
Lists the SAL annotations for structures and classes.
-
Explains how to use SAL annotations with lock mechanisms.
Specifying When and Where an Annotation Applies
Lists the SAL annotations that specify the condition or scope (placement) of other SAL annotations.
-
Lists the intrinsic SAL annotations.
-
Provides examples that show how to use SAL annotations. Also explains common pitfalls.
See Also
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho