diff options
author | 2021-06-01 16:03:22 -0700 | |
---|---|---|
committer | 2021-06-02 21:34:49 +0000 | |
commit | 5d9ee04f569232f3eadbdae214058c87225145cc (patch) | |
tree | cb6bac32c910a2d30955f8c97e87fcf008055e92 /tools/warn/cpp_warn_patterns.py | |
parent | 54b437286b6f2d7827ab4c099710661da467189e (diff) |
Add new Asm/C++/Java/Make warning patterns
* Change some incorrectly-classified logtags warnings to C++.
* Fix gpylint warnings of long lines in html_writer.py.
Test: warn.py --url=http://cs/android --separator='?l=' build.log > warnings.html
Test: warn.py --gencsv build.log > warnings.csv
Change-Id: I98c01dadfd72b202d81ef7c94e93c42182f6065c
Diffstat (limited to 'tools/warn/cpp_warn_patterns.py')
-rw-r--r-- | tools/warn/cpp_warn_patterns.py | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/tools/warn/cpp_warn_patterns.py b/tools/warn/cpp_warn_patterns.py index 2fa9916eca..90759d9891 100644 --- a/tools/warn/cpp_warn_patterns.py +++ b/tools/warn/cpp_warn_patterns.py @@ -91,6 +91,8 @@ warn_patterns = [ [r".*: warning: incompatible redeclaration of library function .+"]), high('Null passed as non-null argument', [r".*: warning: Null passed to a callee that requires a non-null"]), + medium('Unused command line argument', + [r".*: warning: argument unused during compilation: .+"]), medium('Unused parameter', [r".*: warning: unused parameter '.*'"]), medium('Unused function, variable, label, comparison, etc.', @@ -166,6 +168,8 @@ warn_patterns = [ [r".*: warning: '.+' declared with greater visibility than the type of its field '.+'"]), medium('Shift count greater than width of type', [r".*: warning: (left|right) shift count >= width of type"]), + medium('Shift operator precedence', + [r".*: warning: operator .* has lower precedence .+Wshift-op-parentheses.+"]), medium('extern <foo> is initialized', [r".*: warning: '.+' initialized and declared 'extern'", r".*: warning: 'extern' variable has an initializer"]), @@ -239,6 +243,8 @@ warn_patterns = [ [r".*: warning: ignoring #pragma .+"]), medium('Pragma warning messages', [r".*: warning: .+W#pragma-messages"]), + medium('Pragma once in main file', + [r".*: warning: #pragma once in main file .+Wpragma-once-outside-header.*"]), medium('Variable might be clobbered by longjmp or vfork', [r".*: warning: variable '.+' might be clobbered by 'longjmp' or 'vfork'"]), medium('Argument might be clobbered by longjmp or vfork', @@ -333,7 +339,7 @@ warn_patterns = [ low('Deprecated register', [r".*: warning: 'register' storage class specifier is deprecated"]), low('Converts between pointers to integer types with different sign', - [r".*: warning: .+ converts between pointers to integer types with different sign"]), + [r".*: warning: .+ converts between pointers to integer types .+Wpointer-sign\]"]), harmless('Extra tokens after #endif', [r".*: warning: extra tokens at end of #endif directive"]), medium('Comparison between different enums', @@ -410,6 +416,32 @@ warn_patterns = [ [r".*: warning: missing .+Winvalid-pp-token"]), low('need glibc to link', [r".*: warning: .* requires at runtime .* glibc .* for linking"]), + low('Add braces to avoid dangling else', + [r".*: warning: add explicit braces to avoid dangling else"]), + low('Assigning value to self', + [r".*: warning: explicitly assigning value of .+ to itself"]), + low('Comparison of integers of different signs', + [r".*: warning: comparison of integers of different signs.+sign-compare"]), + low('Incompatible pointer types', + [r".*: warning: incompatible .*pointer types .*-Wincompatible-.*pointer-types"]), + low('Missing braces', + [r".*: warning: suggest braces around initialization of", + r".*: warning: too many braces around scalar initializer .+Wmany-braces-around-scalar-init", + r".*: warning: braces around scalar initializer"]), + low('Missing field initializers', + [r".*: warning: missing field '.+' initializer"]), + low('Typedef redefinition', + [r".*: warning: redefinition of typedef '.+' is a C11 feature"]), + low('GNU old-style field designator', + [r".*: warning: use of GNU old-style field designator extension"]), + low('Initializer overrides prior initialization', + [r".*: warning: initializer overrides prior initialization of this subobject"]), + low('GNU extension, variable sized type not at end', + [r".*: warning: field '.+' with variable sized type '.+' not at the end of a struct or class"]), + low('Comparison of constant is always false/true', + [r".*: comparison of .+ is always .+Wtautological-constant-out-of-range-compare"]), + low('Hides overloaded virtual function', + [r".*: '.+' hides overloaded virtual function"]), medium('Operator new returns NULL', [r".*: warning: 'operator new' must not return NULL unless it is declared 'throw\(\)' .+"]), medium('NULL used in arithmetic', |