Polyspace 2017b Not Populating from Code comments
조회 수: 7 (최근 30일)
이전 댓글 표시
It appears that Polyspace 2017b is not reading its own pre-jusifications from the code files. When I copy a justification from the tool to the code, and rerun the analysis, I do not see the comment prefill the columns. The comment does appear in the "Source" window, so the comment is in the correct file.
If I use the previous justification style, I see the columns get prefilled.
In 2017b, the pre-justification looks like:
/* polyspace MISRA-C3:7.1 [[Justified] [Not a Defect]:Low] "Explanation" */
Previous (2016b?) it looks like:
/* polyspace<MISRA-C3:7.1:Not a Defect:Justified> Explanation */
Why does 2017b not properly read the comment copied directly from Polyspace itself?
댓글 수: 0
답변 (2개)
Alexandre De Barros
2017년 11월 7일
편집: Alexandre De Barros
2017년 11월 7일
Hello,
I cannot reproduce this prejustified comment. What Status and Severity have you set for the violation?
Here is an example of justification with R2017b:
/* polyspace MISRA-C3:5.3 [To fix:High] "some comment" */
Indeed, the format of code annotations has changed in this version, and is more flexible. For example, the status, severity and comments are now optional. And to specify the status and the severity, the format is:
[Status:Severity]
In your case, it's like you have two statuses.
The syntax to use is then:
/* polyspace MISRA-C3:7.1 [Not a Defect:Low] "Explanation" */
,if the status should be set to "Not a Defect".
More information on the new format here: https://www.mathworks.com/help/bugfinder/ug/annotate-and-hide-known-or-acceptable-results.html
Alex
댓글 수: 4
Alexandre De Barros
2017년 11월 8일
Hi Trenton,
The new code annotations should be placed on the line where the violation/check/defect is.
Could you try with this new version:
if (Lbl == 0130) // octal label 130 // polyspace MISRA-C3:7.1 [Justified:Low] "Preferred for ease"
The I/O internal error is very suspicious. I suggest you to contact the support, and send the verification log file.
Best regards,
Alexandre
Oliver Mueller
2019년 10월 28일
Looks like this was found to be a bug in Polyspace: https://www.mathworks.com/support/bugreports/details/1799794
Kier
2018년 5월 15일
I have this problem too. The text generated by "Add Pre-Justification To Clipboard" is not an acceptable syntax for Polyspace to recognise.
Here's the clipboard text that doesn't work:
/* polyspace MISRA-C3:2.5 [Justified:Low] "For future debug use." */
...and here's the manually modified syntax that does work:
/* polyspace<MISRA-C3:2.5 : Low : Justified> For future debug use. */
This syntax matches the documentation so the question is really: Why Doesn't the Add Pre-Justification To Clipboard generate the correct syntax?
댓글 수: 2
Alexandre De Barros
2018년 5월 15일
Hi!
Are you placing the code annotation on the line where the violation is? That's where the code annotation should be placed with the new format.
Best regards,
Alexandre
Kier
2018년 5월 16일
Thanks for information. So to summarise:
- There is a new format which is generated by "Add Pre-Justification" and this must go on the same line as the violation.
- The old format which was applied to the succeeding line is still recognised by 2017b.
Is my understanding correct?
Thanks.
Kier.
참고 항목
카테고리
Help Center 및 File Exchange에서 Bug Finder Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!