Function pointer cast to another function pointer with different argument or return type
This defect occurs when a function pointer is cast to another function pointer that has different argument or return type.
This defect applies only if the code language for the project is C.
If you cast a function pointer to another function pointer with different argument or return type and then use the latter function pointer to call a function, the behavior is undefined.
Avoid a cast between two function pointers with mismatch in argument or return types.
See examples of fixes below.
If you do not want to fix the issue, add comments to your result or code to avoid another review. See Address Polyspace Results Through Bug Fixes or Justifications.
| Group: Static memory |
| Language: C | C++ |
| Default: On |
Command-Line Syntax: FUNC_CAST |
| Impact: Medium |