How to: Specify Additional Code Information by Using __analysis_assume

You can provide hints to the code analysis tool for C/C++ code that will help the analysis process and reduce warnings. To provide additional information, use the following function:

__analysis_assume(expr)

expr - any expression that is assumed to evaluate to true.

The code analysis tool assumes that the condition represented by the expression is true at the point where the function appears and remains true until expression is altered, for example, by assignment to a variable.

Note

__analysis_assume does not impact code optimization. Outside the code analysis tool, __analysis_assume is defined as a no-op.