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

Bug#223051: linux-kernel-headers: errors in #includes



linux-kernel-headers contains many erroneous #includes.

These files refer to files that are nowhere to be found under
/usr/include.  The first field is the file name, the second the line
number, and the third the name of the missing file:

linux/acpi.h      35   acpi/acpi_bus.h
linux/acpi.h      36   acpi/acpi_drivers.h
linux/jbd.h       23   jfs_compat.h


These files refer to files that are not in path specified in the include.
The first field is the file name, the second the line number, and the third
the name of the missing file, and the fourth the only file with a matching
basename.

linux/raid/md.h   33   net/checksum.h   asm/checksum.h


These files refer to files that are not in path specified in the include
and for which there are multiple matches for the basename.  The first field
is the file name, the second the line number, the third the name of the
missing file, and the rest all files with matching basenames.

asm/irq.h         16   irq_vectors.h   asm/mach-default/irq_vectors.h
    asm/mach-visws/irq_vectors.h       asm/mach-pc9800/irq_vectors.h
    asm/mach-voyager/irq_vectors.h

asm/mpspec.h      6    mach_mpspec.h   asm/mach-default/mach_mpspec.h 
    asm/mach-es7000/mach_mpspec.h      asm/mach-generic/mach_mpspec.h 
    asm/mach-summit/mach_mpspec.h      asm/mach-numaq/mach_mpspec.h 
    asm/mach-bigsmp/mach_mpspec.h

asm/smp.h         73   mach_apicdef.h  asm/mach-default/mach_apicdef.h 
    asm/mach-es7000/mach_apicdef.h     asm/mach-generic/mach_apicdef.h 
    asm/mach-visws/mach_apicdef.h      asm/mach-summit/mach_apicdef.h 
    asm/mach-numaq/mach_apicdef.h      asm/mach-bigsmp/mach_apicdef.h

linux/acpi.h      34   acpi/acpi.h     asm/acpi.h   linux/acpi.h


This data was generated by running the following script with
/usr/include/linux as an argument after re-installing libc6-dev.


#!/bin/sh

# Headerhacker John G. Hasler 2003 You may treat this program as if it were
# in the public domain.  I waive all rights.

# $1 is the directory of .h files to be scanned.  It defaults to the
# current directory.

# $2 is the directory cpp is to search for #include files.  It defaults to
# /usr/include.

# The files in $1 are pushed through cpp, with cpp searching either
# /usr/include or $2 for #includes.  For each line of output containing 'No
# such file or directory' a line containing the name of the file, the line
# number of the offending #include, and the unfound file is written to the
# file 'inconsistencies'.  $2 is then searched for the basename of the
# third field of each line in 'inconsistencies'.  Lines for which no match
# is found are written to 'missing'.  Lines for which one match is found
# are written to 'one' along with the match.  Lines for which more than one
# match is found are written to 'many' along with all the matches.


/bin/echo -n '' > missing
/bin/echo -n '' > many
/bin/echo -n '' > one

CPPOPT=
CPPDIR="/usr/include"
WD=$PWD

test -n "$1" && cd "$1"

if test -n "$2"
then
    CPPDIR="$2"
    CPPOPT="-nostdinc -I $CPPDIR"
fi

find $PWD -name '*\.h' -exec cpp -P $CPPOPT '{}' \; -printf '%P\n' 2>&1 \
| grep 'No such file or directory' | cut -d' ' -f1-2 \
| sed -e 's/:/ /g' | sort -u > $WD/inconsistencies

while read A B C
do
    D=$(find $CPPDIR -name $(basename $C) -printf ' %P' | sed -e "s% $A%%g")
    if [ -z "$D" ]
    then
        echo $A $B $C >> $WD/missing
    elif echo -n "$D" | grep -q 'h '
    then
        echo $A $B $C $D >> $WD/many
    else
	echo $A $B $C $D >> $WD/one
    fi
done < $WD/inconsistencies



Reply to: