Hello,
I've been trying to resolve a problem I've been having with cppcheck for the past few months, and I think I have pinpointed where the issue is. I've been getting errors like this:
Bailing out from checking ..\..\Sources\asw\aswFaults.c since there was an internal error: Failed to execute 'python "C:\Program Files\Cppcheck\addons\misra.py" --cli --rule-texts=misra_rules.txt --suppress-rules 17.8 ..\..\Sources\asw\aswFaults.c.dump'. Traceback (most recent call last):
File "C:\Program Files\Cppcheck\addons\misra.py", line 3327, in <module>
main()
File "C:\Program Files\Cppcheck\addons\misra.py", line 3271, in main
checker.parseDump(item)
File "C:\Program Files\Cppcheck\addons\misra.py", line 3106, in parseDump
self.executeCheck(905, self.misra_9_5, cfg, data.rawTokens)
File "C:\Program Files\Cppcheck\addons\misra.py", line 3053, in executeCheck
check_function(*args)
File "C:\Program Files\Cppcheck\addons\misra.py", line 1508, in misra_9_5
misra_9.misra_9_x(self, data, 905, rawTokens)
File "C:\Program Files\Cppcheck\addons\misra_9.py", line 405, in misra_9_x
ed = getElementDef(nameToken, rawTokens)
File "C:\Program Files\Cppcheck\addons\misra_9.py", line 420, in getElementDef
createArrayChildrenDefs(ed, nameToken.astParent, rawTokens)
File "C:\Program Files\Cppcheck\addons\misra_9.py", line 431, in createArrayChildrenDefs
foundToken = next(rawToken for rawToken in rawTokens if rawToken.file == token.file and rawToken.linenr == token.linenr and rawToken.column == token.column)
StopIteration
When I posted this error before you guys didn't see an issue because I uploaded the file that was causing the issue and you ran it on that 1 file. If I do the same, it works:
which is causing the python errors. I've zipped up the folder and attached it so maybe you can run and see if you are seeing the same thing. I'm seeing python errors across multiple files in the folder. I'm using the latest cppcheck (2.4.1) with misra.py from the 2.4.1 tag also.
Hello,
I've been trying to resolve a problem I've been having with cppcheck for the past few months, and I think I have pinpointed where the issue is. I've been getting errors like this:
When I execute this:
I'm getting errors like this:
When I posted this error before you guys didn't see an issue because I uploaded the file that was causing the issue and you ran it on that 1 file. If I do the same, it works:
Run:
Result:
It seems like its an issue when I try to run cppcheck on multiple files as follows:
which is causing the python errors. I've zipped up the folder and attached it so maybe you can run and see if you are seeing the same thing. I'm seeing python errors across multiple files in the folder. I'm using the latest cppcheck (2.4.1) with misra.py from the 2.4.1 tag also.
Thanks! This PR should fix the error: https://github.com/danmar/cppcheck/pull/3208 .
Last edit: Georgiy Komarov 2021-04-13
Removed my posting, because it was an erroneous off-topic posting, sorry.
Last edit: Martin Hohl 2021-04-13
thank you guys! This has been a sore spot for a while now.