From owner-cvs-sys Sat Oct 12 15:06:18 1996 Return-Path: owner-cvs-sys Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id PAA03448 for cvs-sys-outgoing; Sat, 12 Oct 1996 15:06:18 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id PAA03432; Sat, 12 Oct 1996 15:06:07 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.7.6/8.6.9) id IAA08426; Sun, 13 Oct 1996 08:05:07 +1000 Date: Sun, 13 Oct 1996 08:05:07 +1000 From: Bruce Evans Message-Id: <199610122205.IAA08426@godzilla.zeta.org.au> To: bde@freefall.freebsd.org, wosch@cs.tu-berlin.de Subject: Re: cvs commit: src/sys/i386/i386 genassym.c src/sys/pci if_fxp.c src/sys/i386/eisa 3c5x9.c src/sys/net if.h if_arp.h if_mib.c src/sys/netinet if_ether.c ip_fw.c Cc: cvs-all@freefall.freebsd.org, CVS-committers@freefall.freebsd.org, cvs-sys@freefall.freebsd.org Sender: owner-cvs-sys@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >>The nested >> include just allowed unportable programs to compile and made my >> simple #include checking program report that networking code doesn't >> need to include . > >where can I find your #include checking program? It is just a stupid shell script that tries recompiling everything one header at a time removed. For the LINT kernel, this takes about twice as long as `make world' :-). I've only used this much for the LINT kernel. It seems to work OK in the source directory for fsck. It depends on plenty of warnings being turned on by default so that removing a header that contains a useful declaration changes the error output. It also finds some bugs in gcc. gcc gets confused when important headers are missing and dumps core. The input file must be prepared by running `make -n >zin' in a clean (kernel) compile directory and editing out the few lines for non-C files. --- while :; do read line if [ -z "$line" ] then rm -f 1 2 1.o 2.o z.c exit fi cmd=`echo $line | sed 's;[ ][^ ]*$;;'` src=`echo $line | sed 's;.* ;;'` echo "trying $src" cat $src >z.c $cmd z.c >/dev/null 2>1 if test -f z.o then mv z.o 1.o else echo "original build of $src failed!" $cmd z.c exit 1 fi for i in `grep -n '^[ ]*#include' $src | sed 's/:.*//' | sort -nr` do sed -e "$i""s/.*//" $src >z.c $cmd z.c >/dev/null 2>2 if test -f z.o then mv z.o 2.o if cmp -s 1 2 && cmp -s 1.o 2.o then echo "line $i in source $src seems to be unnecessary:" head -$i $src | tail -1 # exit 1 fi fi done done