Bug Finder reports false positive MISRA violation 5-0-15 on restrict pointers
조회 수: 2 (최근 30일)
이전 댓글 표시
We are using Bug Finder to check against MISRA C++ rules. Since switching from 2015a to 2017b we face many false positive findings of rule 5-0-15 ("Array indexing shall be the only form of pointer arithmetic") which were not reported as violations earlier.
Example code:
#ifdef _TMS320C6X
#define RESTRICT restrict
#else
#define RESTRICT
#endif
tUInt32 array[1000];
tUInt32* pointerA = &array[0];
pointerA[10] = 1U; // no violation
tUInt32* RESTRICT pointerB = &array[0];
pointerB[10] = 1U; // MISRA violation 5-0-15
In our understanding, accessing an array using a restrict pointer and square-bracket notation should not violate the rule 5-0-15 as it this exactly array indexing.
Thanks for your assistance. Thomas
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 MISRA C:2012 Directives and Rules에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!