I want use cppcheck premium with its graphical user interface as well in a pipeline with it's command line functionality. While using the GUI version everything works well.
When I am reusing the GUI project to run the analysis with the git bash or windows powershell by using the following command:
That is confusing. Are you sure that when you execute cppcheck on the command line that it executes the premium binary? If you write cppcheck --version does it say Cppcheck Premium 24.9.0.1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For your info I get this output on a small simple testfile:
PSC:\Users\Administrator\test1>typetest1.cvoidf();PSC:\Users\Administrator\test1>&'C:\Program Files\Cppcheck premium\cppcheck.exe'--premium=misra-c-2023test1.cCheckingtest1.c...test1.c:2:7:style:Functiontypesshallbeinprototypeformwithnamedparameters[misra-c2023-8.2]voidf();^nofile:0:0:information:Activecheckers:395/1035(use--checkers-report=<filename> to see details) [checkersReport]
I would assume you can reproduce that..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
cppcheck--premium=misra-c-2023test1.cCheckingtest1.c...test1.c:1:7:style:Functiontypesshallbeinprototypeformwithnamedparameters[misra-c2023-8.2]voidf();^nofile:0:0:information:Activecheckers:395/1035(use--checkers-report=<filename> to see details) [checkersReport]
Here is the content of the .cppcheck-file I used. I obfuscated path names with some-path
Using this configuration without the directories in the include dir section, I get the following output:
cppcheck--project=cppcheck_config.cppcheck--enable=styleCheckingtest1.c...Checkingtest1.c:FUNC(rettype,memclass)rettype...test1.c:1:7:style:misraviolation(use--rule-texts=<file>togetproperoutput)[misra-c2012-8.2]voidf();^nofile:0:0:information:Activecheckers:307/1035(use--checkers-report=<filename> to see details) [checkersReport]
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
cppcheck--project=cppcheck_config.cppcheck--enable=styleCheckingtest1.c...Checkingtest1.c:FUNC(rettype,memclass)=rettype...test1.c:1:7:style:misraviolation(use--rule-texts=<file>togetproperoutput)[misra-c2012-8.2]voidf();^nofile:0:0:information:Activecheckers:307/1035(use--checkers-report=<filename> to see details) [checkersReport]
Checkingtest1.c...Checkingtest1.c:FUNC(rettype,memclass)=rettype...test1.c:1:7:style:Functiontypesshallbeinprototypeformwithnamedparameters[misra-c2012-8.2]voidf();^nofile:0:0:information:Activecheckers:395/1035(use--checkers-report=<filename> to see details) [checkersReport]
Last edit: Cpp Checker 2024-11-21
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I want use cppcheck premium with its graphical user interface as well in a pipeline with it's command line functionality. While using the GUI version everything works well.
When I am reusing the GUI project to run the analysis with the git bash or windows powershell by using the following command:
all misra findings have the following description:
Analysing the project without reusing the GUI project file, the message/summary of of the misra finding is correctly displayed.
How can I fix that? Is this a faulty configuration?
Prerequisites:
Windows 10 Pro 22H2
Powershell version: 5.1.19041.5007
Git version: git version 2.43.0.windows.1
CppCheck Premium: 24.9.0.1
Python: 3.12.2
That is confusing. Are you sure that when you execute cppcheck on the command line that it executes the premium binary? If you write
cppcheck --version
does it say Cppcheck Premium 24.9.0.1I just double checked...
let's do it simple.. what happens if you execute cppcheck analysis without using the project file.
a guess, it's possible there are cached results in the cppcheck build dir. so I would suggest that is removed for now.
would it feel ok to share the cppcheck project file here? feel free to obfuscate the paths..
For your info I get this output on a small simple testfile:
I would assume you can reproduce that..
I can reproduce your example:
Here is the content of the .cppcheck-file I used. I obfuscated path names with some-path
Using this configuration without the directories in the include dir section, I get the following output:
Thanks for your quick answers.
In your project file I would like that you remove this line:
So we make sure that you are not just looking at cached results.
And I think you should change the define to:
I believe this will improve the analysis but this will not make the rule text proper.
One more thing you could try would be to run similar analysis on the command line without using the project file at all:
Last edit: Daniel Marjamäki 2024-11-15
With the simple test file and this .cppcheck config
I get the following output:
Concerning your other proposal:
has the proper output
Last edit: Cpp Checker 2024-11-21