数据流缺陷
与数据流编码错误相关的缺陷,如不可达代码、未初始化、缺少返回语句、无用的写入等
这些缺陷是与信息在整个代码中的流动方式相关的错误。这些缺陷包括:
死代码或不可达代码
未使用的代码
未初始化的信息
Polyspace 结果
由始终为 false 的条件停用的代码 | Code segment deactivated by #if 0 directive
or if(0) condition |
死代码 | Code does not execute |
无限循环 | Loop termination condition might never be satisfied (自 R2023a 起) |
缺失 return 语句 | Function with non-void return type does not return value on some
paths |
未初始化的变量 | Variable not initialized before use |
未初始化的指针 | Pointer not initialized before dereference |
未完整访问的数组 | Array partly read or written before end of scope |
指向未初始化值的指针转换为常量指针 | Pointer to constant assigned address that does not contain a value |
静态未调用函数 | Function with static scope not called in file |
不可达代码 | Code not executed because of preceding control-flow statements |
无用的 if 条件 | Unnecessary if conditional |
无用预处理器条件句指令 | Preprocessor conditional directive is always true or always false (自 R2022a 起) |
变量遮蔽 | Variable hides another variable of same name with nested scope |
写入后未被读取 | Variable never read after assignment |
主题
- Bug Finder Defect Groups
The Bug Finder defect checkers are classified into groups such as data flow, concurrency, numerical, and so on.