'cppcheck',
command: [
cppcheck,
- '-I.',
- '-I./src/lib',
- '-I./src/bin',
+ '--check-level=exhaustive',
+ '--enable=all',
'--inline-suppr',
+ '--library=googletest',
+ '--output-file=cppcheck-result.xml',
+ '--project=compile_commands.json',
'--quiet',
- '--max-configs=256',
+ '--report-progress',
f'--suppressions-list=@TOP_SOURCE_DIR@/src/cppcheck-suppress.lst',
'--template={file}:{line}: check_fail: {message} ({severity},{id})',
'--xml',
'--xml-version=2',
- '.',
],
)
endif
'./cppcheck-result.xml',
'--report-dir',
'./report',
+ '--source-dir',
+ TOP_SOURCE_DIR,
'--title',
'"cppcheck report"',
],
-// On some systems cppcheck produces false alarms about 'missing includes'.
-// the following two will suppress, depending on the cppcheck version
-debug
-missingInclude
+// Supress errors that are often false positives.
+missingIncludeSystem
-// Please don't add any suppressions here. We now use inline
-// suppressions (in the .cc files) so that we don't have to
-// maintain line numbers in this file.
-//
-// See the cppcheck manual for syntax. It is something like:
-//
-// // cppcheck-suppress duplicateExpression
-// EXPECT_FALSE(small_name < small_name);
-
-// With cppcheck 1.56, there are a number of false positives, which
-// All of these should be checked and hopefully removed after upgrading
-// cppcheck past 1.56
-
-// eraseDereference: This is a known false positive, which has been
-// fixed in the current development version of cppcheck
-eraseDereference
-
-// Unused functions: there suddenly are a lot of unused function errors
-// We could address those by adding for instance early declarations or
-// (unnecessary) header files, but they were all somewhat false positives
-// When we upgrade past 1.56, we should re-check this, and perhaps enable
-// unused-functions again.
-unusedFunction
+// Supress errors from external sources.
+*:/usr/include/*
+*:/usr/src/googletest/*