If I don't supply the rules file, I get output. But it seems that the script goes and checks every included header file: [Apguard/System/Src/newlib_stubs.c:61]: (style) misra violation (use --rule-texts=<file> to get proper output) [misra-c2012-3.1] [STM32F3xx/CMSIS/Device/STM32F3xx/Inc/stm32f398xx.h:5809]: (style) misra violation (use --rule-texts=<file> to get proper output) [misra-c2012-5.4] [STM32F3xx/CMSIS/Device/STM32F3xx/Inc/stm32f398xx.h:5809]: (style) misra violation (use --rule-texts=<file>...
If I remove the misrarules.txt rules file, the script goes on, finishes and prints a bunch of stuff on stderr. I will have to see what is wrong in the rules file, it follows the structure as indicated: Appendix A: Summary of guidelines Rule 11.4 text Rule 11.5 text ... Does the misra.py creates an output file? Or the stderr has to be captured?
Ok, I have a complete .dump file, the python call doesn't exit with error, BUT: the python call never finishes either. Using Python 2.7, the attached dump file, the call to misra.py never exists. The command prompt hangs indefinitely. Any advice on how to figure out what is going on? Is there a verbose mode for misra.py that would show the progress of processing?
Hi versat, Thank you for your help, I've figured out what is the problem: if the --dump option is combined with the --check-config, then the incomplete dump files are generated. I've copied all the arguments from the regular cppcheck invocation into the dump command, thus the two options ended up together. There should be some mutual exclusion detection built into cppcheck for these two options. The python script now executes, I can start using it.
Output with python 2.7.16rc1: python misra.py syscalls.c.dump Traceback (most recent call last): File "misra.py", line 2191, in <module> checker.parseDump(item) File "misra.py", line 2005, in parseDump data = cppcheckdata.parsedump(dumpfile) File "F:\WinBuild\Tools\Cppcheck\addons\cppcheckdata.py", line 735, in parsedump return CppcheckData(filename) File "F:\WinBuild\Tools\Cppcheck\addons\cppcheckdata.py", line 697, in init data = ET.parse(filename) File "C:\Python27\lib\xml\etree\ElementTree.py",...
It will produce the same error with python 2.7.16. I'm attaching bith the dump and the c file, hopefully you can help. I'm just a user when it comes to python.
Hi, I'm running into an error while trying to run the misra.py addon. I'm trying to run the script on a .dump file, as per the documentation. Could anybody give some direction what could be wrong? Please see the details below. Environment: Command line Python: python-3.7.2 CppCheck: latest git master Command with no issues: F:\WinBuild\Tools\Cppcheck\addons>python cppcheckdata.py syscalls.c.dump - command executes without errors Command failing: F:\WinBuild\Tools\Cppcheck\addons>python misra.py syscalls.c.dump...