I have Microsoft Visual C++ 2015 Redistributable (x64) - 14.0.23026 installed at work. Unfortunately, I am not allowed to install anything else. I have the portable version of python-3.7.1 and am able to run cppcheck.exe and the GUI. However, running them with MISRA enabled gives me the following python error: "No module named 'cppcheckdata'". Any suggestions?
Thanks!
P.S. - I have this running at home since I can install everything there. At work it's a different beast since I am not even allowed local admin rights.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I do have it in the addons folder, along with all the other *.py files that were installed at home. It's slightly different since it's been modified recently, but I am using the same one at home.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
BTW, I cannot install CPPCheck at work, in addition to Python. What I did was install it on my Win10 64-bit at home and copied the files to my Win7 64-bit computer at work. CPPCheck works for everything except MISRA. While Python at work is the portable version, it is installed at home. So that may be the issue, but I can't figure out what's missing.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Which version of Cppcheck do you use?
How exactly do you start the analysis? GUI, Commandline?
Do the other addons also not work? For example the "cert" addon?
If you use the GUI the addon scripts should be either in the same directory as the executable or in a subfolder named "addons" (this is how they are installed). Cppcheck should be able to find them then. I remember that in earlier versions there were some problems that could prevent it, so it would be the best to use the latest version 1.85.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Cppcheck 1.85.
All from the GUI.
I haven't tried any other python addons to be honest. Since today's a holiday and I'm not at work, I'll try it tomorrow.
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Do you have this key path in your registry?: [HKEY_CURRENT_USER\Software\Cppcheck\Cppcheck-GUI]
There should then be an entry like "Python path"="C:/Python27/python.exe" in it beside others.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Like I said, I can't install anything at work. I can't even edit the registry. I'm just running CPPCheck at work without installation. So I guess it won't work.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok, if you can not even look at the registry this is hard to solve i guess.
You can try to add the python path temporarily to the path variable.
Running this in a .bat file for example maybe works:
SET PATH=%PATH%;c:/python/
cppcheckgui.exe
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have installed Cppcheck 1.85 and created misrarules.text and given the path in addon Tab. But I can't see any misra warnings in the stdout after I analyse the file. could you please let me know if I have to add any other item
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Make sure your Misra rules has the following format:
Appendix A Summary of guidelines
Rule 1.1
Description of Rule 1.1.
...
Rule M.N
Description of Rule M.N.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hmm I wonder if we can be more informative when something does not match. or add some more strict format (Line 1 must say "Appendix A Summary of guidelines", Line 2 must say "Rule 1.1" etc..).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for the reply. Should the description also contain whether it is required or advisory.
Currenly I could style, error, information,warning and so on. Would there be different icon to display the misra warning. How does the GUI show this ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
As it is, the misra.py code (line 1872) reads in what type of enforcement it is. However, as seen on lines 1895-1896, it only reads it in but does not display it anywhere. So if you wish to display it with the description, I recommend you use:
Rule 1.1
Required - Description of Rule 1.1.
For a more correct answer than line 2040, your Misra rules file can be of the following form (with the warning type in between the rule number and description):
Rule 1.1
Required
Description of Rule 1.1.
However, the warning line is not used when it is in its own seperate line. Thus, prepend each description with the type instead.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you very much for your support. Misra is working in command line. But it is not working in the GUI. Could you please let me know if I have do any changes for GUI ?
Thanks & Regards
Shobana
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have Microsoft Visual C++ 2015 Redistributable (x64) - 14.0.23026 installed at work. Unfortunately, I am not allowed to install anything else. I have the portable version of python-3.7.1 and am able to run cppcheck.exe and the GUI. However, running them with MISRA enabled gives me the following python error: "No module named 'cppcheckdata'". Any suggestions?
Thanks!
P.S. - I have this running at home since I can install everything there. At work it's a different beast since I am not even allowed local admin rights.
put this file in the same directory as misra.py:
https://github.com/danmar/cppcheck/blob/master/addons/cppcheckdata.py
I do have it in the addons folder, along with all the other *.py files that were installed at home. It's slightly different since it's been modified recently, but I am using the same one at home.
BTW, I cannot install CPPCheck at work, in addition to Python. What I did was install it on my Win10 64-bit at home and copied the files to my Win7 64-bit computer at work. CPPCheck works for everything except MISRA. While Python at work is the portable version, it is installed at home. So that may be the issue, but I can't figure out what's missing.
Which version of Cppcheck do you use?
How exactly do you start the analysis? GUI, Commandline?
Do the other addons also not work? For example the "cert" addon?
If you use the GUI the addon scripts should be either in the same directory as the executable or in a subfolder named "addons" (this is how they are installed). Cppcheck should be able to find them then. I remember that in earlier versions there were some problems that could prevent it, so it would be the best to use the latest version 1.85.
Cppcheck 1.85.
All from the GUI.
I haven't tried any other python addons to be honest. Since today's a holiday and I'm not at work, I'll try it tomorrow.
Thanks!
None of the other addons work. I assume that it's not seeing my python path for some reason even though I add it in the GUI.
Do you have this key path in your registry?:
[HKEY_CURRENT_USER\Software\Cppcheck\Cppcheck-GUI]
There should then be an entry like
"Python path"="C:/Python27/python.exe"
in it beside others.Like I said, I can't install anything at work. I can't even edit the registry. I'm just running CPPCheck at work without installation. So I guess it won't work.
Ok, if you can not even look at the registry this is hard to solve i guess.
You can try to add the python path temporarily to the path variable.
Running this in a .bat file for example maybe works:
Thanks, but it didn't help. I guess the registry is now needed; and I don't have local admin access to install or write to the registry.
I have installed Cppcheck 1.85 and created misrarules.text and given the path in addon Tab. But I can't see any misra warnings in the stdout after I analyse the file. could you please let me know if I have to add any other item
Make sure your Misra rules has the following format:
Appendix A Summary of guidelines
Rule 1.1
Description of Rule 1.1.
...
Rule M.N
Description of Rule M.N.
hmm I wonder if we can be more informative when something does not match. or add some more strict format (Line 1 must say "Appendix A Summary of guidelines", Line 2 must say "Rule 1.1" etc..).
Thank you for the reply. Should the description also contain whether it is required or advisory.
Currenly I could style, error, information,warning and so on. Would there be different icon to display the misra warning. How does the GUI show this ?
As it is, the misra.py code (line 1872) reads in what type of enforcement it is. However, as seen on lines 1895-1896, it only reads it in but does not display it anywhere. So if you wish to display it with the description, I recommend you use:
Rule 1.1
Required - Description of Rule 1.1.
For a more correct answer than line 2040, your Misra rules file can be of the following form (with the warning type in between the rule number and description):
Rule 1.1
Required
Description of Rule 1.1.
However, the warning line is not used when it is in its own seperate line. Thus, prepend each description with the type instead.
As Bassam says, you will not get different icons.
Hi ,
Thank you very much for your support. Misra is working in command line. But it is not working in the GUI. Could you please let me know if I have do any changes for GUI ?
Thanks & Regards
Shobana