指定代码行为
指定代码行为(例如变量范围、库使用情况和其他信息),以减少 Polyspace® Bug Finder™ 分析中的假正和假负结果
为了减少假正和假负结果,请提供有关您代码的更多信息。例如:
使用
约束设置 (-data-range-specifications)选项指定对元素的约束,例如变量范围和指针允许的缓冲区大小。使用
-code-behavior-specifications将代码中的函数映射到已知的标准库函数。使用
-code-behavior-specifications指定代码中禁止的标识符或宏。使用
-asm-begin -asm-end选项指定汇编代码的边界。使用
-code-behavior-specifications选项指定需要以不同方式分析的代码。例如,您可以指定包含实时函数、内存管理函数、异常处理函数或关键数据成员的代码。分析从 Simulink® 模型生成的代码时,请指定参数、输入和单步函数,以准确地对数据流进行建模。
使用此处列出的分析选项,向 Polyspace Bug Finder 更详细地描述您的代码,这有助于提高分析精度并加快分析速度。
Polyspace 选项
主题
提供更多信息
- Modify Bug Finder Checkers Through Code Behavior Specifications
Change Polyspace interpretation of code elements such as functions by assigning code behaviors in XML or Datalog format. - Flag Deprecated or Unsafe Functions, Keywords, or Macros Using Bug Finder Checkers
Create a blocklist of functions, keywords and macros, and check for use of items from the list. - Extend Bug Finder Checkers for Standard Library Functions to Custom Libraries
Map custom library functions to equivalent Standard Library functions so that domain errors and other issues can be detected. - Extend Concurrency Defect Checkers to Unsupported Multithreading Environments
Find data races and other concurrency issues in multithreading environments that are not supported by default. - Extend Data Race Checkers to Atomic Operations
Find data races in operations that are assumed to be atomic by Bug Finder.
指定外部约束
- Specify External Constraints for Polyspace Analysis
Constrain variable ranges and pointer specifications for more precise analysis. - 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.