Invalid parameter of stubbed function
Parameter of a stubbed function is not valid
Description
This check determines if arguments passed to a stubbed function matches its parameters. Polyspace® creates expectation for the passed arguments based on the prototype of the stubbed function and if the expectations are not met, this check is reported.
Polyspace checks the parameter of a stubbed function if the parameter satisfies these criteria:
Parameter is not a pointer to void
(void*).Parameter is not a pointer to a function.
Parameter is not a pointer to a structure the definition of which is not available to the analysis.
For checked pointer parameters, Polyspace checks if the pointer is a null pointer. If the pointer is not null, Polyspace checks if it is allocated with sufficient memory to accommodate the pointed
type. Additionally, if the pointed object is const-qualified, Polyspace checks if the pointed memory is initialized.
For checked array parameter with length N and type
T, Polyspace checks that the first element of the array points to a valid location and that
N elements of type T can be dereferenced.
Additionally, if the array is a const array, Polyspace checks if the array elements are initialized.
This check is reported only if you specify the option -check-parameter-of-stubbed-functions.
Diagnosing This Check
To diagnose this check, read the message on the Result Details pane. The message shows the expected argument and the actual argument that causes a result:

To investigate the root cause of the issue further, verify that the argument passed to the reported function matches the parameter of the stubbed function.
Examples
Check Information
| Group: Other |
| Language: C|C++ |
Acronym:
stub_precondition
|