Merge "Add new clang and clang-tidy warning patterns"

This commit is contained in:
Treehugger Robot
2021-09-23 23:31:01 +00:00
committed by Gerrit Code Review
2 changed files with 10 additions and 2 deletions

View File

@@ -93,6 +93,8 @@ warn_patterns = [
[r".*: warning: Null passed to a callee that requires a non-null"]),
medium('Unused command line argument',
[r".*: warning: argument unused during compilation: .+"]),
medium('Set but not used',
[r".*: warning: .* set but not used.*Wunused-but-set"]),
medium('Unused parameter',
[r".*: warning: unused parameter '.*'"]),
medium('Unused function, variable, label, comparison, etc.',

View File

@@ -23,15 +23,19 @@ from .cpp_warn_patterns import compile_patterns
from .severity import Severity
def tidy_warn_pattern(description, pattern):
def tidy_warn(description, patterns):
return {
'category': 'C/C++',
'severity': Severity.TIDY,
'description': 'clang-tidy ' + description,
'patterns': [r'.*: .+\[' + pattern + r'\]$']
'patterns': patterns,
}
def tidy_warn_pattern(description, pattern):
return tidy_warn(description, [r'.*: .+\[' + pattern + r'\]$'])
def simple_tidy_warn_pattern(description):
return tidy_warn_pattern(description, description)
@@ -168,6 +172,8 @@ warn_patterns = [
simple_tidy_warn_pattern('portability-simd-intrinsics'),
group_tidy_warn_pattern('portability'),
tidy_warn('TIMEOUT', [r".*: warning: clang-tidy aborted "]),
# warnings from clang-tidy's clang-analyzer checks
analyzer_high('clang-analyzer-core, null pointer',
[r".*: warning: .+ pointer is null .*\[clang-analyzer-core"]),