[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: darcs on the ia64



>>>>> On Fri, 18 Feb 2005 16:21:27 -0800, Randolph Chung <tausq@debian.org> said:

  Randolph> the build log of tex4ht contains many warnings that are
  Randolph> indicative of 64-bit problems. for example:

  Randolph> t4ht.c: In function `main':
  Randolph> t4ht.c:1574: warning: implicit declaration of function `kpse_var_value'
  Randolph> t4ht.c:1574: warning: cast to pointer from integer of different size

These are usually fatal and are a sign of a missing #include.  If there is
a lot of noise, you can run the log through the attached script.  Everything
it reports is pretty much guaranteed to cause a segfault upon execution.

	--david

#!/usr/bin/env python

#
# Copyright (c) 2004 Hewlett-Packard Development Company, L.P.
#	David Mosberger <davidm@hpl.hp.com>
#
# Scan standard input for GCC warning messages that are likely to
# source of real 64-bit problems.  In particular, see whether there
# are any implicitly declared functions whose return values are later
# interpreted as pointers.  Those are almost guaranteed to cause
# crashes.
#
import re
import sys

implicit_pattern = re.compile("([^:]*):(\d+): warning: implicit declaration "
                              + "of function `([^']*)'")
pointer_pattern = re.compile(
    "([^:]*):(\d+): warning: "
    + "("
    +  "(assignment"
    +  "|initialization"
    +  "|return"
    +  "|passing arg \d+ of `[^']*'"
    +  "|passing arg \d+ of pointer to function"
    +  ") makes pointer from integer without a cast"
    + "|"
    + "cast to pointer from integer of different size)")
last_implicit_filename = ""
last_implicit_linenum = -1
last_implicit_func = ""

while True:
    line = sys.stdin.readline()
    if line == '':
        break
    m = implicit_pattern.match(line)
    if m:
        last_implicit_filename = m.group(1)
        last_implicit_linenum = int(m.group(2))
        last_implicit_func = m.group(3)
    else:
    	m = pointer_pattern.match(line)
        if m:
            pointer_filename = m.group(1)
            pointer_linenum = int(m.group(2))
            if (last_implicit_filename == pointer_filename
                and last_implicit_linenum == pointer_linenum):
                print "Function `%s' implicitly converted to pointer at " \
                      "%s:%d" % (last_implicit_func, last_implicit_filename,
                                 last_implicit_linenum)



Reply to: