Skip to content

Commit 0f9af39

Browse files
committed
[fix] Cppcheck suppress unusedFunction checker only once
Cppcheck 2.17 fails when a checker is suppressed multiple times. Fixes #4498
1 parent a1411fd commit 0f9af39

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • analyzer/codechecker_analyzer/analyzers/cppcheck

analyzer/codechecker_analyzer/analyzers/cppcheck/analyzer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ def construct_analyzer_cmd(self, result_handler):
219219

220220
# unusedFunction check is for whole program analysis,
221221
# which is not compatible with per source file analysis.
222-
analyzer_cmd.append('--suppress=unusedFunction')
222+
if '--suppress=unusedFunction' not in analyzer_cmd:
223+
analyzer_cmd.append('--suppress=unusedFunction')
223224

224225
# Add extra arguments.
225226
analyzer_cmd.extend(config.analyzer_extra_arguments)

0 commit comments

Comments
 (0)