Reply To: MWEdit

Home Forums Projects MWEdit Reply To: MWEdit

#5394

Playing around with the cppcheck configuration some and this is what I’ve currently got for the settings:
cppcheck --enable=all -I . --inconclusive --language=c++ --library=mfc --library=microsoft_atl --output-file=cppcheck.log --platform=win64 --quiet .
I’m currently unsure about --cppcheck-build-dir but it may be useful as well with --cppcheck-build-dir=.

It doesn’t seem as though cppcheck supports config files, which would be nice as we’ll need to ultimately run it against multiple platform configurations but that can be fixed by adding shell scripts to the repository if we feel that it would be helpful.

  • --enable=all turns on all of the checks, including the ones not turned on by default
  • -I . tells it to look for the include paths relative to the root directory
  • --inconclusive tells it to turn on additional checks that it can’t necessarily confirm (useful for catching functions that use different parameters in the declaration and defintion)
  • --language=c++ ensures that headers are being parsed as C++ instead of C, which is important as sometimes very little C++ is used in headers so C is detected instead
  • --library=mfc and --library=microsoft_atl tells it to load the configuration files for dealing with MFC and the ATL stuff.
  • --output-file=cppcheck.log saves the run to a log file to make it easier to sift through
  • --platform=win64 tells it to load the configuration for Windows (which, as we know, differs from other, more standard compliant platforms) and to check to make sure everything is 64-bit compliant
  • --quiet tells it not to report anything in the terminal

I’ll update the threads soon with a progress update 🙂