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!