On 12/05/2010 07:28 AM, Kinkie wrote:
Hi all,
   Eric Raymond recently released a tool named deheader
(http://www.catb.org/esr/deheader/) which goes through c/c++ project
looking for unneeded includes.
It does so by trying to compile each source file after removing one
#include statement at a time, and seeing if it builds.
I tried it on squid, and the result was unexpected: it seems that the
c++ sources for squid contain up to 915 unneeded #include directives
(on an Ubuntu box, with all build options enabled).

The estimate is of course not realistic, as it can't account for other
platforms or feature-includes, but it is still worth a check IMVHO.
I've opened a feature-branch for the purpose at
lp:~kinkie/squid/deheader with a first round of de-headerization.

Thoughts? Comments?

Removing unneeded includes can reduce build time so this can be a useful project, provided we do not end up spending more time fixing portability bugs caused by header removal.

The results of this beheading should not be committed until the changes are at least tested on Hudson, IMO.

Thank you,

Alex.

Reply via email to