9

I have a semi-large Visual Studio solution, with a series of different build configurations, and various platforms. I really only want to check one or two configurations, on a single platform. However, I don't see a way in the CppCheck manual to select a build configuration when you use the --project flag. I've tried to use --platform; however, that doesn't even just select configurations for that platform (win64 still checks win32 configs).

Is there a way with CppCheck to select a singular build configuration in a solution, or at a maybe even exclude certain configurations?

Vaillancourt
  • 1,380
  • 1
  • 11
  • 42
Dirv
  • 737
  • 1
  • 6
  • 13

1 Answers1

1

I added the --project option in Cppcheck.

In the command line tool you do not have a good way to select a single configuration. This is a missing feature. Somehow I want to give the user some control of this, but I do not want to add additional cppcheck arguments. I think that the --platform option should exclude mismatching configurations, that sounds like a good start.

For information; in the GUI you can select a platform and only get analysis of the first matching DEBUG configuration.

Daniel Marjamäki
  • 2,907
  • 15
  • 16
  • Is there any progress made on checking only one particular project configuration? I'm using CppCheck 1.87. – Scrontch Apr 09 '19 at 13:50
  • I think it will be fixed soon. there is a pull request.. https://github.com/danmar/cppcheck/pull/1795 – Daniel Marjamäki Apr 10 '19 at 17:22
  • That would be great! Also, why not have it as a command line switch? Please allow it on the command line. – Scrontch Apr 12 '19 at 07:08
  • I am careful about adding command line switches. I don't think command lines that have 100's of random command line options are that useful. If we add every option people want to have it will be 100's of random options soon.. A GUI option is much more flexible; we can transform and group these options more easily when we see a need for that. – Daniel Marjamäki Apr 13 '19 at 09:40
  • CppCheck is definitively a tool that is usefull in an automated build environment. And for these, command line switches are far more usefull - i would even say essential - compared to clumsy config files. Does GUI option even mean that i have to use the GUI to use it? Please not! This disqualifies it for use in an automated environment. Please think about that. – Scrontch Apr 14 '19 at 12:28
  • I think that usage in various CI scripts is a priority. For doxygen there are 100's of options. They have chosen to have a configuration file. It seems to me that is the way forward for Cppcheck also. It is imho clumpsy to have 100's of command line options. My idea is that you will configure cppcheck with the GUI but the CI scripts etc can just run the command line tool. This is how doxygen works. – Daniel Marjamäki Apr 15 '19 at 13:42
  • Some other advanced options I rather keep away from the command line ; "custom dump file location", "max ctu depth", "check code in headers", "check code in unused templates", "output results in plist format", "redirect results to file", various addon options i.e. "misra rule texts", "path for python binary", etc.. Most of these options are available in the gui project now. If we start to add every option that people want to have on the command line then I believe we will soon have 100 options. – Daniel Marjamäki Apr 15 '19 at 14:40