C++ 检查
特定于 C++ 代码的检查
Polyspace® Code Prover™ 中的 C++ 特定检查用于检查源于 C++ 特定范式的运行时错误,例如,面向对象的编程和异常处理。这些错误大多数不会出现在 C 代码中。
Polyspace 结果
不正确的面向对象编程 | Dynamic type of this pointer is incorrect |
无效的 C++ 特定运算 | C++ specific invalid operations occur |
未返回值的函数 | C++ function does not return value when expected |
调用方法的 this 指针为空 | this pointer is null during member
function call |
未捕获异常 | Exception propagates uncaught to the main or another entry-point
function |
主题
- Review and Fix Invalid C++ Specific Operations Checks
Determine root cause of nonpositive array size or incorrect usage of
typeid
ordynamic_cast
operator. - Review and Fix Uncaught Exception Checks
Investigate how an exception can escape uncaught from the function where it is thrown.
- Review and Fix Function Not Returning Value Checks
Identify paths through your function body that do not end in a
return
statement. - Review and Fix Null This-pointer Calling Method Checks
Investigate why the pointer to the current object can be
NULL
-valued. - Review and Fix Incorrect Object Oriented Programming Checks
Investigate why a certain
virtual
member call orthis
pointer usage represents an incorrect pattern of object oriented programming.