Add MISRA and error comment

5 views (last 30 days)
Salvatore Nappi
Salvatore Nappi on 23 Jul 2018
Answered: Salvatore Nappi on 3 Oct 2018
Hi,
is there a quickly procedure (without using GUI) to insert MISRA and error comment in the source code?
Could you give me any support, please?
Thanks in advance

Answers (4)

Alexandre De Barros
Alexandre De Barros on 25 Jul 2018
Hello,
No, there is no way to quickly annotate the code itself. What is the need here, and how would you choose the violations and errors to annotate?
Best regards,
Alexandre

Salvatore Nappi
Salvatore Nappi on 26 Jul 2018
Hello Alexandre, I need to insert MISRA C2012 justification in the source code. The procedure should be the following by using ps_results.psbf file and Polyspace: 1) for each MISRA violation identify the line source code where violation is present 2) Select the violation in the Polyspase GUI (on the left interface) and chose the correct values for Status and Severity. After selecting the violation, select "Add pre-justification to clipboard" in the menu (with right button) and paste the comment in the source code, the same with Defect. The ps_results.psbf is generated by using the bug finder command polyspace\\bin\\polyspace-bug-finder-nodesktop.exe" -lang C -options-file Could you tell me if my procedure is correct and if exist a faster alternative procedure
Best Regards
  1 Comment
Alexandre De Barros
Alexandre De Barros on 27 Jul 2018
Hello Salvatore,
In other words, you would like to have, from a commented violation or defect in the Results List, a new command in the contextual menu to automatically add the annotation in the code, instead of selecting "Add pre-justification to clipboard", edit the file at the right line and paste the annotation (something you can already do today).
As explained earlier, this is not possible for the moment, but I can make this suggestion to the R&D team.
Best regards,
Alexandre

Sign in to comment.


Salvatore Nappi
Salvatore Nappi on 21 Aug 2018
Hello Alexander, is possible to get a report that contains information about the lines where are present the MISRA 2012 violations in the source code? In this way should be more quickly to insert the MISRA comment directly in the source code without using the GUI. Best regards
Salvatore
  1 Comment
Alexandre De Barros
Alexandre De Barros on 22 Aug 2018
Hello Salvatore !
The line numbers for the coding rule violations are available in reports generated from Code Prover only.
Alex

Sign in to comment.


Salvatore Nappi
Salvatore Nappi on 3 Oct 2018
Hello Alexander, I have a question regarding MISRA rule 11.4. I executed the MISRA verification by using Polyspace 2017 e 2018 on the same source code and I faced that the MISRA rule 11.4 was indicated in the report with Polyspace 2017 but not for 2018 and the source code was the same. Could you give me any details about this behavior, please?
Thanks in advance

Community Treasure Hunt

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

Start Hunting!