Skip to content

Commit 8e20196

Browse files
committed
Update warn.py with more warnings
Change-Id: Ic65e6effe2be60d6a6c2a53c6acf356ad9e7ea94
1 parent 4f85d00 commit 8e20196

File tree

1 file changed

+42
-2
lines changed

1 file changed

+42
-2
lines changed

tools/warn.py

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env python
2+
# This file uses the following encoding: utf-8
23

34
import sys
45
import re
@@ -51,6 +52,7 @@ def colorforseverity(sev):
5152
{ 'category':'C/C++', 'severity':severity.MEDIUM, 'members':[], 'option':'',
5253
'description':'Incompatible pointer types',
5354
'patterns':[r".*: warning: assignment from incompatible pointer type",
55+
r".*: warning: return from incompatible pointer type",
5456
r".*: warning: passing argument [0-9]+ of '.*' from incompatible pointer type",
5557
r".*: warning: initialization from incompatible pointer type"] },
5658
{ 'category':'C/C++', 'severity':severity.HIGH, 'members':[], 'option':'-fno-builtin',
@@ -61,7 +63,8 @@ def colorforseverity(sev):
6163
'patterns':[r".*: warning: unused parameter '.*'"] },
6264
{ 'category':'C/C++', 'severity':severity.MEDIUM, 'members':[], 'option':'-Wunused',
6365
'description':'Unused function, variable or label',
64-
'patterns':[r".*: warning: '.+' defined but not used"] },
66+
'patterns':[r".*: warning: '.+' defined but not used",
67+
r".*: warning: unused variable '.+'"] },
6568
{ 'category':'C/C++', 'severity':severity.MEDIUM, 'members':[], 'option':'-Wunused-value',
6669
'description':'Statement with no effect',
6770
'patterns':[r".*: warning: statement with no effect"] },
@@ -82,6 +85,9 @@ def colorforseverity(sev):
8285
'patterns':[r".*: warning: comparison between signed and unsigned",
8386
r".*: warning: comparison of promoted \~unsigned with unsigned",
8487
r".*: warning: signed and unsigned type in conditional expression"] },
88+
{ 'category':'C/C++', 'severity':severity.MEDIUM, 'members':[], 'option':'',
89+
'description':'Comparison between enum and non-enum',
90+
'patterns':[r".*: warning: enumeral and non-enumeral type in conditional expression"] },
8591
{ 'category':'libpng', 'severity':severity.MEDIUM, 'members':[], 'option':'',
8692
'description':'libpng: zero area',
8793
'patterns':[r".*libpng warning: Ignoring attempt to set cHRM RGB triangle with zero area"] },
@@ -214,6 +220,12 @@ def colorforseverity(sev):
214220
{ 'category':'java', 'severity':severity.MEDIUM, 'members':[], 'option':'',
215221
'description':'Java: Non-varargs call of varargs method with inexact argument type for last parameter',
216222
'patterns':[r".*: warning: non-varargs call of varargs method with inexact argument type for last parameter"] },
223+
{ 'category':'aapt', 'severity':severity.MEDIUM, 'members':[], 'option':'',
224+
'description':'aapt: No default translation',
225+
'patterns':[r".*: warning: string '.+' has no default translation in .*"] },
226+
{ 'category':'aapt', 'severity':severity.MEDIUM, 'members':[], 'option':'',
227+
'description':'aapt: Missing default or required localization',
228+
'patterns':[r".*: warning: \*\*\*\* string '.+' has no default or required localization for '.+' in .+"] },
217229
{ 'category':'aapt', 'severity':severity.MEDIUM, 'members':[], 'option':'',
218230
'description':'aapt: String marked untranslatable, but translation exists',
219231
'patterns':[r".*: warning: string '.+' in .* marked untranslatable but exists in locale '??_??'"] },
@@ -228,7 +240,8 @@ def colorforseverity(sev):
228240
'patterns':[r".*: warning: backslash and newline separated by space"] },
229241
{ 'category':'C/C++', 'severity':severity.MEDIUM, 'members':[], 'option':'-Warray-bounds',
230242
'description':'Array subscript out of bounds',
231-
'patterns':[r".*: warning: array subscript is above array bounds"] },
243+
'patterns':[r".*: warning: array subscript is above array bounds",
244+
r".*: warning: array subscript is below array bounds"] },
232245
{ 'category':'C/C++', 'severity':severity.MEDIUM, 'members':[], 'option':'',
233246
'description':'Decimal constant is unsigned only in ISO C90',
234247
'patterns':[r".*: warning: this decimal constant is unsigned only in ISO C90"] },
@@ -265,6 +278,9 @@ def colorforseverity(sev):
265278
{ 'category':'cont.', 'severity':severity.SKIP, 'members':[], 'option':'',
266279
'description':'',
267280
'patterns':[r".*: warning: '.+'"] },
281+
{ 'category':'cont.', 'severity':severity.SKIP, 'members':[], 'option':'',
282+
'description':'',
283+
'patterns':[r".*: warning: base '.+'"] },
268284
{ 'category':'cont.', 'severity':severity.SKIP, 'members':[], 'option':'',
269285
'description':'',
270286
'patterns':[r".*: warning: when initialized here"] },
@@ -301,6 +317,9 @@ def colorforseverity(sev):
301317
{ 'category':'C/C++', 'severity':severity.LOW, 'members':[], 'option':'-Wcomment',
302318
'description':'Line continuation inside comment',
303319
'patterns':[r".*: warning: multi-line comment"] },
320+
{ 'category':'C/C++', 'severity':severity.LOW, 'members':[], 'option':'-Wcomment',
321+
'description':'Comment inside comment',
322+
'patterns':[r".*: warning: "".+"" within comment"] },
304323
{ 'category':'C/C++', 'severity':severity.HARMLESS, 'members':[], 'option':'',
305324
'description':'Extra tokens after #endif',
306325
'patterns':[r".*: warning: extra tokens at end of #endif directive"] },
@@ -339,6 +358,24 @@ def colorforseverity(sev):
339358
{ 'category':'C/C++', 'severity':severity.MEDIUM, 'members':[], 'option':'',
340359
'description':'Converting from <type> to <other type>',
341360
'patterns':[r".*: warning: converting to '.+' from '.+'"] },
361+
{ 'category':'C/C++', 'severity':severity.MEDIUM, 'members':[], 'option':'',
362+
'description':'Return value from void function',
363+
'patterns':[r".*: warning: 'return' with a value, in function returning void"] },
364+
{ 'category':'C/C++', 'severity':severity.LOW, 'members':[], 'option':'',
365+
'description':'Useless specifier',
366+
'patterns':[r".*: warning: useless storage class specifier in empty declaration"] },
367+
{ 'category':'logtags', 'severity':severity.LOW, 'members':[], 'option':'',
368+
'description':'Duplicate logtag',
369+
'patterns':[r".*: warning: tag "".+"" \(None\) duplicated in .+"] },
370+
{ 'category':'C/C++', 'severity':severity.MEDIUM, 'members':[], 'option':'',
371+
'description':'Operator new returns NULL',
372+
'patterns':[r".*: warning: 'operator new' must not return NULL unless it is declared 'throw\(\)' .+"] },
373+
{ 'category':'C/C++', 'severity':severity.MEDIUM, 'members':[], 'option':'',
374+
'description':'NULL used in arithmetic',
375+
'patterns':[r".*: warning: NULL used in arithmetic"] },
376+
{ 'category':'C/C++', 'severity':severity.MEDIUM, 'members':[], 'option':'',
377+
'description':'Use of deprecated method',
378+
'patterns':[r".*: warning: '.+' is deprecated .+"] },
342379

343380
# these next ones are to deal with formatting problems resulting from the log being mixed up by 'make -j'
344381
{ 'category':'C/C++', 'severity':severity.SKIP, 'members':[], 'option':'',
@@ -491,6 +528,9 @@ def compilepatterns():
491528
# read the log file and classify all the warnings
492529
lastmatchedline = ''
493530
for line in infile:
531+
# replace fancy quotes with plain ol' quotes
532+
line = line.replace("‘", "'");
533+
line = line.replace("’", "'");
494534
if warningpattern.match(line):
495535
if line != lastmatchedline:
496536
classifywarning(line)

0 commit comments

Comments
 (0)