主要内容

本页翻译不是最新的。点击此处可查看最新英文版本。

数据流检查

检查变量读取、函数返回值和条件语句

Polyspace® Code Prover™ 中的数据流检查用于检查与程序中的信息流相关的运行时错误,例如:

  • 正在读取的变量是否已初始化。

  • 条件语句的分支是否可达。

  • 在运行时是否调用某个函数。

Polyspace 结果

未调用函数函数已定义但未调用
不可达函数Function is called from unreachable part of code
全局变量未在初始化代码中赋值Global variable is not assigned a value in the initialization section of program
未初始化的局部变量Local variable is not initialized before being read
未初始化的指针Pointer is not initialized before being read
未初始化的变量不是局部变量的变量在被读取前未初始化
返回值未初始化C function does not return value when expected
不可达代码在执行期间无法到达的代码

主题