Hello!
Thanks for a great piece of software.
I'm just getting started making my own addons to cppcheck. However, I always get an internal error when running any addon via cppcheck itself.
When I run it on an error- and warning-free cpp file, everything is OK:
However, when the file contains any error triggered by an addon, I get the following:
$ cppcheck --enable=all --addon=findcasts.py main.cpp
Checking main.cpp ...
[main.cpp:3]: (style) Variable 'y' is assigned a value that is never used.
[main.cpp:0]: (information) Bailing out from checking main.cpp since there was an internal error: "type mismatch! call is<type>() before get<type>()"&& is<int64_t>()
Running the addon from python and not via cppcheck is fine though.
$ cppcheck --dump --quiet main.cpp
$ python findcasts.py main.cpp.dump
Checking main.cpp.dump...
[main.cpp:3](information) found a cast [findcasts-cast]
I haven't tried many addons, just findcasts.py and threadsafety.py.
It looks like you are using Cppcheck V1.88 with newer addons from the repository. Maybe this causes the trouble.
The latest version of Cppcheck is now V1.89. Many things regarding the addons were changed/fixed, so maybe you can try Version 1.89 with the corresponding addons?
The change of the variable name from "col" to "column" was made not too long ago (after the release of 1.88): https://github.com/danmar/cppcheck/commit/2d9a13181747e36e0b82fcd92bd412ae1a427104
Python 2.7.10 should be fine. We try to support Python 2.7 and 3.x at the moment and we also use pylint now to do some basic checks for every commit (added after the release of 1.88).
If all this does not help please let us know.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello!
Thanks for a great piece of software.
I'm just getting started making my own addons to cppcheck. However, I always get an internal error when running any addon via cppcheck itself.
When I run it on an error- and warning-free cpp file, everything is OK:
However, when the file contains any error triggered by an addon, I get the following:
Running the addon from python and not via cppcheck is fine though.
I haven't tried many addons, just findcasts.py and threadsafety.py.
To make the addons work at all, I also had to change this line: https://github.com/danmar/cppcheck/blob/bb54e455ce940eead8e8475cb73a6401bf3519ab/addons/cppcheckdata.py#L254 to 'col' instead of 'column'.
I'm using cppcheck 1.88 on MacOS. My python version is 2.7.10.
Thanks,
Stefan
It looks like you are using Cppcheck V1.88 with newer addons from the repository. Maybe this causes the trouble.
The latest version of Cppcheck is now V1.89. Many things regarding the addons were changed/fixed, so maybe you can try Version 1.89 with the corresponding addons?
The change of the variable name from "col" to "column" was made not too long ago (after the release of 1.88):
https://github.com/danmar/cppcheck/commit/2d9a13181747e36e0b82fcd92bd412ae1a427104
Python 2.7.10 should be fine. We try to support Python 2.7 and 3.x at the moment and we also use pylint now to do some basic checks for every commit (added after the release of 1.88).
If all this does not help please let us know.