Open belliriccardo opened 1 day ago
is ok before 1.5.2?
UPDATE: I tried running the same command run by the plugin in a cmd shell, and I get the following:
Weird.. adding an actual misra.json
file containing the following content I get a bit further:
(I pass --addon=C:/path/to/misra.json
instead of the actual json itself). Like this I get a bit further, and I get one problem detected by Cppcheck itself, but not misra.py:
I tried adding a print("TEST")
again right before the main in the script and this is what I get instead:
Which inside of VSCode gets translated as the error message that I posted about earlier:
is ok before 1.5.2?
Sorry I wrote my message before I saw this reply; I was using quite often for misra checks in my code and I didn't notice any particular problems.
I have an update, I managed to get the plugin to work manually by creating a .bat
like so (inspired from this):
"C:/Program` Files/Cppcheck/cppcheck.exe" --verbose --dump --template={file}:{line}:{column}: {severity}: CWE-{cwe} {message}:[{id}] --enable=warning -j1 --max-ctu-depth=2 --platform=native --std=c99 --std=c++03 --inline-suppr --report-progress <includes here> --suppress=misra-c2012-2.5 --suppress=misra-c2012-2.4 --suppress=misra-c2012-8.9 --suppress=misra-c2012-19.2 <predefined symbols here> c:\DATI\REPO\PROJECT_NAME\src\main.c
pause
python "C:/Program Files/Cppcheck/addons/misra.py" --rule-texts=misra-rules-2012.txt src/main.c.dump
Like this I managed to get the following output: Which is the correct output for the file at hand.
C:/Program` Files/Cppcheck/cppcheck.exe --- whcih version?
Cppcheck 2.15 (open source) http://cppcheck.net/
https://files.cppchecksolutions.com/manual.pdf
It feels like Misra has been migrated to Premium features.
So I have version 2.15, but I also have the rules file, so I should be good. Meaning, the program works providing the misra-rules-2012.txt
to the program. I don't think that's the issue. You can see in my previous post that the program correctly runs and I get the correct output:
I have an update, I managed to get the plugin to work manually by creating a
.bat
like so (inspired from this):"C:/Program` Files/Cppcheck/cppcheck.exe" --verbose --dump --template={file}:{line}:{column}: {severity}: CWE-{cwe} {message}:[{id}] --enable=warning -j1 --max-ctu-depth=2 --platform=native --std=c99 --std=c++03 --inline-suppr --report-progress <includes here> --suppress=misra-c2012-2.5 --suppress=misra-c2012-2.4 --suppress=misra-c2012-8.9 --suppress=misra-c2012-19.2 <predefined symbols here> c:\DATI\REPO\PROJECT_NAME\src\main.c pause python "C:/Program Files/Cppcheck/addons/misra.py" --rule-texts=misra-rules-2012.txt src/main.c.dump
Like this I managed to get the following output: Which is the correct output for the file at hand.
Hmmm, could you share more info about your setup? Also which python version are you using?
Hi! I'm having trouble making the extension work with the "misra.py" addon. Before the latest updates (before 1.5.2) I had the settings (in settings.json) like this: But that doesn't work anymore: So (temporarily) I hardcoded the full path of the plugin (
C:\\Users\\riccardo.b\\.vscode\\extensions\\qiumingge.cpp-check-lint-1.5.4\\bin\\win64\\addons\\misra.py
), and I tried running it again but it still fails to catch very simple misra errors. I then wondered if the python file actually got executed, so I went and modified it like so: I just added a smallprint
(there are many throughout the code) and like this I get this error message when trying to analyze a single file (with right click -> cpp-check-lint -> cppcheck-file).So the "TEST" gets printed but the whole program then gets aborted? Also It seems that there is some sort of problem when selecting a single file, as I don't think that the
--file-list
argument is correct. It would also be nice to go back to selecting the addon with just the relative path (misra.py
instead ofC:\\Users\\riccardo.b\\.vscode\\...
), I don't know what happened there honestly.