配置代码约束
对全局变量、函数输入和插桩函数等代码中的元素设定约束
Polyspace® 会对变量范围和允许的指针缓冲区大小等元素做出假设。您可以对这些元素应用约束,以从分析中排除不相关的代码路径并提高结果的准确度:
全局变量
用户定义的函数
插桩函数
Polyspace 选项
Polyspace 宏
unchecked_assert | Constrain variable ranges for static analysis with Polyspace products |
主题
外部约束
- External Constraints for Polyspace Analysis
Look up constraints that you can apply on global variables, function inputs and stubbed functions. - XML File Format for Polyspace Analysis Constraints
Look up specifications of the XML file for constraint specification, if you are editing the XML directly.
对 Code Prover 分析设定约束
- Reduce Orange Checks in Polyspace Code Prover
Improve your coding design or adjust your verification options for more precise verification. - Specify External Constraints for Polyspace Analysis
Constrain variable ranges and pointer specifications for more precise analysis.
- Test Functions and Constrain Polyspace Code Prover Analysis for Ranges of Inputs and Outputs (Polyspace Test)
Test functions over one or more ranges of input and verify if the output is within a valid range using range specification macros. Run static analysis on the function and associated tests using the specified ranges as external constraint. - Constrain Variable Ranges for Polyspace Analysis Using Manual Stubs and Manual main() Function
Improve precision of Polyspace Code Prover™ analysis using your own stubs andmain().
假设
- Code Prover Assumptions About Stubbed Functions
The verification stubs undefined functions or functions that you want stubbed, and makes certain assumptions about their arguments and return values.