필터 지우기
필터 지우기

code prover annotation for false positives

조회 수: 4 (최근 30일)
Bas Wielens
Bas Wielens 2018년 2월 1일
답변: Lucas Lebert 2018년 4월 17일
Hello,
we are using code prover for static analysis of our code. Some findings are false positives and I would like to exclude them for future runs. Code prover seem to have this possibility over annotations in our code. However, these do not work. I have tried:
  • /* polyspace<MISRA-C3:5.4:Not a defect:No action planned> "Comment" */
  • /* polyspace +1 MISRA-C3:5.4 [Justified] "Comment" */
None of them work, findings are still visible in the results.
What would be the correct syntax?
Thanks, Bas

답변 (1개)

Lucas Lebert
Lucas Lebert 2018년 4월 17일

Hi, Bas!

If you justify the defects in the code, Polyspace automatically sets the review settings of the defect in the results accordingly. By setting the severity to "Not a defect" as you did in your example, the results should match that.

You mentioned, that the defects are still visible. Indeed it is not possible to delete the defect completely from the results, it is only possible to justify the defect. It will still be visible there, but with the severity, status and the comment of your justification in the code.

With that being said another common mistake is that the justification in the code is not in the same line as the defect. You could justify the same defect in multiple lines of code by using the syntax /* polyspace:begin and /* polyspace:end, as described here: Review Comments

Have a great day! ~Lucas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by