I've installed CPPCheck Premium and would like to run an analysis from the GUI that includes checking against MISRA C. I think I need to enable that in the addons tab under preferences? That tab is not displaying any addons. A few things...
The python binary path is blank, but python is in the path (I confirmed by running it in a command shell).
The program directory does have an addon directory, and there are a number of python scripts within it
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I actually did that when I opened the original project. However, I didn't see MISRA violations called out as such in the GUI after analysis. So I assumed MISRA checking was turned off.
I just opened a saved XML file in a text editor, and it does look like the MISRA violations are marked as MISRA violations in the XML file. So, I guess my follow up questions are:
Is reading "error id" in the XML file the only or best way to determine which issues are MISRA violations?
Why doesn't the MISRA addon show up in the Addons tab?
One additional question (which I'm sure is a dumb one): what is the purpose of "Since Date"?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I suggest that you show the error id in the GUI. Edit, Preferences. Then click on the "display error id in column "Id" checkbox.
Because maybe in one project you check MISRA and then in another project you don't. The preferences are for global options that apply to all your projects.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The idea of the "Since Date" is to show when a warning was first detected by Cppcheck. Well that feature does not work that well I am afraid maybe it's better to remove it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
One more thing... when I go to File/Open Project File, it displays the attached screen under addons, which seems to indicate that MISRA checking is not available? But the MISRA results do end up being generated.
One more thing... when I go to File/Open Project File, it displays the attached screen under addons, which seems to indicate that MISRA checking is not available? But the MISRA results do end up being generated.
Can you please check that you find the misra.py addon in the installation folder.
I cannot explain immediately why you get MISRA results but there are warnings generated by the premiumaddon maybe it's those that you see. But still .. if you can't check that checkbox then I am confused why it writes misra results.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well misra.py provides MISRA C. It's identical to the misra.py provided in open source cppcheck. premiumaddon.exe provides various premium features for instance MISRA C++. premiumaddon.exe is not in the addon folder so it's not seen in the screenshot above.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've installed CPPCheck Premium and would like to run an analysis from the GUI that includes checking against MISRA C. I think I need to enable that in the addons tab under preferences? That tab is not displaying any addons. A few things...
Almost. Create a project (File,New Project). In the project dialog that is shown, enable misra in its addons tab.
That sounds normal. You only need to write a path if you want to override it.
I actually did that when I opened the original project. However, I didn't see MISRA violations called out as such in the GUI after analysis. So I assumed MISRA checking was turned off.
I just opened a saved XML file in a text editor, and it does look like the MISRA violations are marked as MISRA violations in the XML file. So, I guess my follow up questions are:
One additional question (which I'm sure is a dumb one): what is the purpose of "Since Date"?
The idea of the "Since Date" is to show when a warning was first detected by Cppcheck. Well that feature does not work that well I am afraid maybe it's better to remove it.
That's all helpful, thanks.
One more thing... when I go to File/Open Project File, it displays the attached screen under addons, which seems to indicate that MISRA checking is not available? But the MISRA results do end up being generated.
Can you please check that you find the misra.py addon in the installation folder.
I cannot explain immediately why you get MISRA results but there are warnings generated by the premiumaddon maybe it's those that you see. But still .. if you can't check that checkbox then I am confused why it writes misra results.
misra.py is in a subdirectory of the installation directory; attached is a screenshot of the directories/addons I'm seeing.
The weird thing is that I remember selecting MISRA checking, I think when I created my first project. Now it seems that something has changed.
Screenshot 2023-09-01 103640.png indicates that you have the MISRA C++ 2008 addon,
but not the MISRA C 2012 addon. Is that what you have ?
Are they two different .py files ?
Well misra.py provides MISRA C. It's identical to the misra.py provided in open source cppcheck. premiumaddon.exe provides various premium features for instance MISRA C++. premiumaddon.exe is not in the addon folder so it's not seen in the screenshot above.
Since I have premium, should premiumaddon.exe be in the addon folder?
no
I thought I was supposed to get MISRA C with Premium?
Your screenshot looks correct. hmm.. strange that the gui says "not found"?!
misra.py is the MISRA C addon.
MISRA C++ 2008 is provided in the premium addon. premiumaddon.exe
Last edit: Daniel Marjamäki 2023-09-01