Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Apr 2000 12:53:31 +0200
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        Brian Somers <brian@Awfulhak.org>
Cc:        Greg Lehey <grog@lemis.com>, current@FreeBSD.ORG, brian@hak.lan.Awfulhak.org
Subject:   Re: PATCH: Removal of unneeded <sys/kernel.h> 
Message-ID:  <64619.956832811@critter.freebsd.dk>
In-Reply-To: Your message of "Thu, 27 Apr 2000 11:14:26 BST." <200004271014.LAA01935@hak.lan.Awfulhak.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <200004271014.LAA01935@hak.lan.Awfulhak.org>, Brian Somers writes:

>> Yes, the src/tools/tools/kerninclude script first renames the include
>> and if the source file still compiles it declares a "no-read" and
>> leaves the #include intact.
>
>The thing that's screwed me up the most doing this sort of thing is 
>something like:
>
>  #include <net/if_tun.h>         /* For TUNS* ioctls */
>  ....
>  #ifdef TUNSIFMODE  
>    /* Make sure we're POINTOPOINT */
>    iff = IFF_POINTOPOINT;
>    if (ID0ioctl(bundle.dev.fd, TUNSIFMODE, &iff) < 0)
>      log_Printf(LogERROR, "bundle_Create: ioctl(TUNSIFMODE): %s\n",
>                 strerror(errno));
>  #endif
>
>hence the comments beside many of the includes in ppp.  I think the 
>only way to ensure something really can be removed is to compile with 
>& without and ensure that the resulting object is the same modulo 
>embedded compile dates.

If the MD5 over the generated object file changes after substituting an
empty file for the include, I consider it "used" by default, so that
case should be covered as well.

--
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD coreteam member | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?64619.956832811>