What is the correct annotation syntax in Polyspace Bug Finder/Code Prover for multi-line comment annotations in source code?

42 ビュー (過去 30 日間)
Ryan
Ryan 2014 年 3 月 3 日
回答済み: Anirban 2022 年 5 月 23 日
When annotating source code using the documented method in the Polyspace Bug Finder user guide the additional comments in the annotation are not included in the analysis results in the comment columns. Here is an example of the syntax used:
/* polyspace:begin<MISRA-CPP:7-3-6:Not a defect:Justify with annotations>
These additional comments not showing up in results browser in the comments column */
<the code block>
/* polyspace:end<MISRA-CPP:7-3-6:Not a defect:Justify with annotations> */
Based on the user guide for Polyspace this should be the syntax used. Could I be missing something to allow Polyspace to recognize the multi-line annotation comment to correctly put the additional comments into the comment field of the results viewer and any associated reports?

回答 (2 件)

Alexandre De Barros
Alexandre De Barros 2014 年 3 月 11 日
The syntax is correct if there is no carriage return between "annotations>" and "These". If there is no carriage return, could you give a try with the latest version, 14a? If the problem is still there, I suggest you to contact the Technical Support.
Alex
  1 件のコメント
Ryan
Ryan 2014 年 3 月 11 日
There is a carriage return, which is needed to keep the source line within an acceptable length requirement, namely 120 characters. We currently use selected JSF checkers and the line length check is one that is enabled. I talked with a field application engineer for Polyspace and they confirmed that multi-line annotations are not valid with the current releases of Polyspace, but it may be updated in future releases.

サインインしてコメントする。


Anirban
Anirban 2022 年 5 月 23 日
Since R2019b, Polyspace supports results annotations that are spread over multiple lines. See R2019b release notes.
To learn about Polyspace annotation syntax for justifying results, see Annotate Code and Hide Known or Acceptable Results.

Community Treasure Hunt

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

Start Hunting!

Translated by