2- The method described in cppcheck docs to do a "single run" doesn't really work:
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
The file compile_commands.json is created in the current folder. Now run Cppcheck like this:
cppcheck --project=compile_commands.json
fails with
Bailing out from checking ...scantool/scantool_aif.c since there was an internal error: bad macro syntax. macroname=CURFILE value=\"scantool_aif.c\"
etc.
3- Running cppcheck standalone, per file, fails differently because it doesn't define stuff like unix etc.
4- Running cppcheck-gui with the cppcheck_proj file I just committed isn't perfect : it manually defines unix and HAVE_STRCASECMP, but otherwise doesn't duplicate what the cmake configuration would do.
ideas: 1- https://stackoverflow.com/questions/48625499/cppcheck-support-in-cmake
2- The method described in cppcheck docs to do a "single run" doesn't really work:
fails with
Bailing out from checking ...scantool/scantool_aif.c since there was an internal error: bad macro syntax. macroname=CURFILE value=\"scantool_aif.c\"
etc.3- Running cppcheck standalone, per file, fails differently because it doesn't define stuff like unix etc.
4- Running cppcheck-gui with the cppcheck_proj file I just committed isn't perfect : it manually defines unix and HAVE_STRCASECMP, but otherwise doesn't duplicate what the cmake configuration would do.