Main Content

Check Behavior

Modify default behavior of run-time checks

To modify the default behavior of a run-time check, use the check behavior options. For instance, by default, the Overflow check detects overflows in computations with signed integers only. You can specify that the check must also detect overflows in computations with unsigned integers.

Polyspace Options

expand all

Allow negative operand for left shifts (-allow-negative-operand-in-shift)Allow left shift operations on a negative number
Overflow mode for signed integer (-signed-integer-overflows)Specify whether result of overflow is wrapped around or truncated
Overflow mode for unsigned integer (-unsigned-integer-overflows)Specify whether result of overflow is wrapped around or truncated
Disable checks for non-initialization (-disable-initialization-checks)Disable checks for non-initialized variables and pointers
Check that global variables are initialized after warm reboot (-check-globals-init)Check that global variables are assigned values in designed initialization code (Since R2020a)
Detect stack pointer dereference outside scope (-detect-pointer-escape)Find cases where a function returns a pointer to one of its local variables
Enable pointer arithmetic across fields (-allow-ptr-arith-on-struct)Allow arithmetic on pointer to a structure field so that it points to another field
Allow incomplete or partial allocation of structures (-size-in-bytes)Allow a pointer with insufficient memory buffer to point to a structure
Permissive function pointer calls (-permissive-function-pointer)Allow type mismatch between function pointers and the functions they point to
Detect uncalled functions (-uncalled-function-checks)Detect functions that are not called directly or indirectly from main or another entry point function
Consider non finite floats (-allow-non-finite-floats)Enable an analysis mode that incorporates infinities and NaNs
Infinities (-check-infinite)Specify how to handle floating-point operations that result in infinity
NaNs (-check-nan)Specify how to handle floating-point operations that result in NaN
Subnormal detection mode (-check-subnormal)Detect operations that result in subnormal floating-point values
Enable impact analysis (-impact-analysis)Check for presence or absence of impact between program elements designated as sources and sinks (Since R2023b)
Specify sources and sinks (-impact-specifications)Specify XML file that identifies program elements as sources and sinks for impact analysis (Since R2023b)
Show impact analysis results only (-impact-analysis-only)Skip regular Code Prover checks for run-time errors and perform impact analysis only (Since R2023b)
Calculate stack usage (-stack-usage)Compute and display the estimates of stack usage (Since R2022a)

Topics

Modifying Default Behavior of Run-time Checks

Setting up Impact Analysis