Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/forwardanalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,9 @@ namespace {
Token::simpleMatch(tok->linkAt(1), ") {")) {
if ((settings.vfOptions.maxForwardBranches > 0) && (++branchCount > settings.vfOptions.maxForwardBranches)) {
// TODO: should be logged on function-level instead of file-level
reportError(Severity::information, "normalCheckLevelMaxBranches", "Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.");
if (settings.severity.isEnabled(Severity::information)) {
reportError(Severity::information, "normalCheckLevelMaxBranches", "Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.");
}
return Break(Analyzer::Terminate::Bail);
}
Token* endCond = tok->linkAt(1);
Expand Down
11 changes: 11 additions & 0 deletions test/cli/other_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2038,6 +2038,17 @@ def test_builddir_hash_check_level(tmp_path): # #13376
build_dir = tmp_path / 'b1'
os.mkdir(build_dir)

args = [ # // #14029
'--enable=warning', # to execute the code which generates the normalCheckLevelMaxBranches message
'--cppcheck-build-dir={}'.format(build_dir),
'--template=simple',
str(test_file)
]

exitcode, stdout, stderr = cppcheck(args)
assert exitcode == 0, stdout
assert stderr == ''

args = [
'--enable=warning', # to execute the code which generates the normalCheckLevelMaxBranches message
'--enable=information', # to show the normalCheckLevelMaxBranches message
Expand Down