4
# Copyright (c) 2004 Hewlett-Packard Development Company, L.P.
5
# David Mosberger <davidm@hpl.hp.com>
6
# Copyright 2010 Canonical Ltd.
8
# Permission is hereby granted, free of charge, to any person
9
# obtaining a copy of this software and associated documentation
10
# files (the "Software"), to deal in the Software without
11
# restriction, including without limitation the rights to use,
12
# copy, modify, merge, publish, distribute, sublicense, and/or sell
13
# copies of the Software, and to permit persons to whom the
14
# Software is furnished to do so, subject to the following
17
# The above copyright notice and this permission notice shall be
18
# included in all copies or substantial portions of the Software.
20
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
22
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
25
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27
# OTHER DEALINGS IN THE SOFTWARE.
29
# Scan standard input for GCC warning messages that are likely to
30
# source of real 64-bit problems. In particular, see whether there
31
# are any implicitly declared functions whose return values are later
32
# interpreted as pointers. Those are almost guaranteed to cause
38
implicit_pattern = re.compile(
39
"([^:]*):(\d+):(\d+:)? warning: implicit declaration "
40
"of function [`']([^']*)'")
41
pointer_pattern = re.compile(
42
"([^:]*):(\d+):(\d+:)? warning: "
47
+ "|passing arg \d+ of `[^']*'"
48
+ "|passing arg \d+ of pointer to function"
49
+ ") makes pointer from integer without a cast"
51
+ "cast to pointer from integer of different size)")
54
last_implicit_filename = ""
55
last_implicit_linenum = -1
56
last_implicit_func = ""
63
for arg in sys.argv[1:]:
66
elif arg == '--warnonly':
71
line = sys.stdin.readline()
73
sys.stdout.write(line)
77
m = implicit_pattern.match(line)
79
last_implicit_filename = m.group(1)
80
last_implicit_linenum = int(m.group(2))
81
last_implicit_func = m.group(4)
83
m = pointer_pattern.match(line)
85
pointer_filename = m.group(1)
86
pointer_linenum = int(m.group(2))
87
if (last_implicit_filename == pointer_filename
88
and last_implicit_linenum == pointer_linenum):
89
err = "Function `%s' implicitly converted to pointer at " \
90
"%s:%d" % (last_implicit_func, last_implicit_filename,
91
last_implicit_linenum)
102
Our automated build log filter detected the problem(s) above that will
103
likely cause your package to segfault on architectures where the size of
104
a pointer is greater than the size of an integer, such as ia64 and amd64.
106
This is often due to a missing function prototype definition.
108
Since use of implicitly converted pointers is always fatal to the application
109
on ia64, they are errors. Please correct them for your next upload.
111
More information can be found at:
112
http://wiki.debian.org/ImplicitPointerConversions
117
if __name__ == '__main__':