From 28a44e25bc9ec1a964a5c6252cbddd4120f7b6b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sun, 21 Jan 2018 16:43:47 +0100 Subject: [PATCH] Manual: Added a chapter about misra --- man/manual.docbook | 68 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 65 insertions(+), 3 deletions(-) diff --git a/man/manual.docbook b/man/manual.docbook index 9cccd74ed..74a554a96 100644 --- a/man/manual.docbook +++ b/man/manual.docbook @@ -5,7 +5,7 @@ Cppcheck 1.82 - 2017-08-12 + 2018-01-21 @@ -528,8 +528,8 @@ cppcheck -DA --force file.c Cppcheck can generate output in XML format. Use --xml to enable this format. - A sample command to check a file and output - errors in the XML format: + A sample command to check a file and output errors in the + XML format: cppcheck --xml file1.cpp @@ -750,6 +750,68 @@ gui/test.cpp,16,error,mismatchAllocDealloc,Mismatching allocation and deallocati \t (horizontal tab) are supported. + + Misra + + Cppcheck has an addon that checks for MISRA C + 2012 compliance. + + It is not allowed to publish the MISRA rule + texts. Therefore the MISRA rule texts are not available + directly in the addon. Instead, the addon can read the rule texts either + from the Misra PDF file or from a text file. + +
+ Requirements + + The Cppcheck MISRA addon requires: + + + + Python 2.X or 3.X + + + + For rule texts; MISRA PDF/Text file + + +
+ +
+ MISRA PDF + + If you want your code to be MISRA compliant + then you probably have the MISRA PDF. + + However the MISRA PDF can only be used directly by the addon if + the xpdf package is installed, it is a cross platform + open source package. +
+ +
+ MISRA Text file + + If you have installed xpdf, this text file can + be easily generated on the command line (using + pdftotext that is included in + xpdf): + + pdftotext misra-c-2012.pdf output.txt + + Other pdf-to-text utilities might work also. + + To create the text file manually, copy paste Appendix A "Summary + of guidelines" from the MISRA PDF. Format: + + Appendix A Summary of guidelines +Rule 1.1 +Rule text +Rule 1.2 +Rule text +... +
+
+ Suppressions