![]() Consider this example that shows the C runtime function memcpy: void * memcpy(Ĭan you tell what this function does? When a function is implemented or called, certain properties must be maintained to ensure program correctness. SAL can help you make your code design more understandable, both for humans and for code analysis tools. Simply stated, SAL is an inexpensive way to let the compiler check your code for you. ![]() ![]() By using SAL annotations, you can describe your functions in greater detail so that developers who are consuming them can better understand how to use them. Natively, C and C++ provide only limited ways for developers to consistently express intent and invariance. For more information about SAL 2.0 for Windows driver development, see SAL 2.0 Annotations for Windows Drivers. Visual Studio code analysis for C++ uses SAL annotations to modify its analysis of functions. ![]() The annotations are defined in the header file. The Microsoft source-code annotation language (SAL) provides a set of annotations that you can use to describe how a function uses its parameters, the assumptions that it makes about them, and the guarantees that it makes when it finishes. ![]()
0 Comments
Leave a Reply. |