Polyspace 2017b Not Populating from Code comments

9 views (last 30 days)
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?

Answers (2)

Alexandre De Barros
Alexandre De Barros on 7 Nov 2017
Edited: Alexandre De Barros on 7 Nov 2017
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".
Alex
  4 Comments
Alexandre De Barros
Alexandre De Barros on 8 Nov 2017
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
Oliver Mueller on 28 Oct 2019
Looks like this was found to be a bug in Polyspace: https://www.mathworks.com/support/bugreports/details/1799794

Sign in to comment.


Kier
Kier on 15 May 2018
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 Comments
Alexandre De Barros
Alexandre De Barros on 15 May 2018
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
Kier on 16 May 2018
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.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!