Skip to content

Incompatibility between CodeChecker 6.24.4 and cppcheck 2.17.1 #4498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
plexilcrf opened this issue Mar 20, 2025 · 5 comments
Open

Incompatibility between CodeChecker 6.24.4 and cppcheck 2.17.1 #4498

plexilcrf opened this issue Mar 20, 2025 · 5 comments

Comments

@plexilcrf
Copy link

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) | 454d978
Git tag information | 6.24.4-tainted

cppcheck version
Installed via homebrew
Cppcheck 2.17.1

To Reproduce
Steps to reproduce the behaviour:

  1. Run setup.sh (sets up Python virtual environment, some configuration files)
  2. Run run-codechecker (shell script)
  3. 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
  1. Examine report.txt

See attached files requirements.txt, report.txt. (Unable to upload shell scripts, CodeChecker configuration files)

requirements.txt
report.txt

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.

@amai2012
Copy link

Can you name an older version of cppcheck which is working well?

@SweetVishnya
Copy link
Contributor

Experiencing the same problem here(

@plexilcrf
Copy link
Author

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.

@SweetVishnya
Copy link
Contributor

It seems that Cppcheck 2.16.2 works fine with CodeChecker

@aag-norbert-lange
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants