MATLAB: Does PolySpace not report overflows as expected

Polyspace Client for C/C++

I created an example that should cause an overflow when calculating the sum from the arguments b and c, but PolySpace reports all lines to be save:
void myfun (void)
{
unsigned short a = 0;
unsigned short b = 255;
unsigned short c = 650000;
a = b + c;
}

Best Answer

To make sure PolySpace detects overflows for unsigned integer variables please select the "-detect-unsigned-overflows" option.
In the PolySpace GUI this option can be set at
PolySpace inner settings -> Assumptions -> Detect overflows
on unsigned integers.