Incompatibility between CodeChecker 6.24.4 and cppcheck 2.17.1
Describe the bug
cppcheck 2.17.1 fails with error message:
cppcheck: error: suppression 'unusedFunction' already exists
CodeChecker version
Installed via pip
Base package version | 6.24.4
Package build date | 2024-10-28T15:46
Git commit ID (hash) | 454d978191ed42c8202a2244dc092dfb6fd8c83a
Git tag information | 6.24.4-tainted
cppcheck version
Installed via homebrew
Cppcheck 2.17.1
To Reproduce Steps to reproduce the behaviour:
- Run
setup.sh(sets up Python virtual environment, some configuration files) - Run
run-codechecker(shell script) - Observe output:
Logging the build...
Analyzing...
Analysis of some files failed. Continuing.
Generating report...
Done. See /Users/cfry/src/planner_test/CodeChecker_build/report.txt
- Examine report.txt
See attached files requirements.txt, report.txt. (Unable to upload shell scripts, CodeChecker configuration files)
Expected behaviour Expected cppcheck to run normally.
Desktop (please complete the following information)
- Hardware: MacBook Pro 16-inch, 2019 (Intel), 32 GB RAM
- OS: macOS Sonoma 14.7.4
- Python: Python 3.12.9, installed via
homebrew - Browser: not relevant to this report
Additional context
Unable to upload configuration files or shell scripts. unusedFunction occurs nowhere in them.
Can you name an older version of cppcheck which is working well?
Experiencing the same problem here(
Can you name an older version of cppcheck which is working well?
I don't have an answer for this yet, I've run into unrelated issues trying to get cppcheck 2.16.0 working with CodeChecker. Will report back when I have an answer.
It seems that Cppcheck 2.16.2 works fine with CodeChecker
I changed the following to make it work. I am not aware of the consequences.
--- a/analyzer/codechecker_analyzer/analyzers/cppcheck/analyzer.py
+++ b/analyzer/codechecker_analyzer/analyzers/cppcheck/analyzer.py
@@ -218,7 +218,7 @@ class Cppcheck(analyzer_base.SourceAnalyzer):
# unusedFunction check is for whole program analysis,
# which is not compatible with per source file analysis.
- analyzer_cmd.append('--suppress=unusedFunction')
+ # analyzer_cmd.append('--suppress=unusedFunction')
# Add extra arguments.
analyzer_cmd.extend(config.analyzer_extra_arguments)
--
2.47.2
Can confirm, after applying this patch, cppcheck was able to run successfully.