CodeProver does not detect overflow for non-volatile global variables
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
In an attempt to check the following ticket https://ch.mathworks.com/matlabcentral/answers/374199-codeprover-does-not-detect-overflow-underflow-with-unsigned-variables, I have noticed that CodeProver does not detect potential overflow when manipulating global variables which are not volatile. If I add the volatile keyword, CodeProver does raise a warning.
int8_t a, b, c;
volatile int8_t d, e, f;
void test (void){
a = b-c; // No warning
d = e-f; // Warning raised
}
I have tried also by making some computation on these variables somewhere else in the code, but the result is the same.
Is this a confirmed behavior on your side?
댓글 수: 0
채택된 답변
Alexandre De Barros
2018년 1월 4일
Hello,
I cannot reproduce your results: I have overflows for both volatile and non-volatile variables.
Are b and c full-range in your results ?
Alex
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Multitasking에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!