Re: Feature branch launched: deheader

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Sun, 05 Dec 2010 20:56:44 -0700

On 12/05/2010 07:59 PM, Amos Jeffries wrote:
> On Sun, 5 Dec 2010 15:28:00 +0100, Kinkie<gkinkie_at_gmail.com> 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?
>
> Auditing your "first batch" commit...
>
> Disconnecting .cc from squid.h is fine under the current content of that
> file. However when it is removed config.h always needs to be added in its
> place. You will get false success results if they are both missing.
> Particularly in the optional code as they are the only source of USE_* and
> HAVE_* definition.

Perhaps there is a way to tell deheader to assume that squid.h and/or
config.h should always be there? We can fix them manually if needed.

Alex.
Received on Mon Dec 06 2010 - 03:57:08 MST

This archive was generated by hypermail 2.2.0 : Mon Dec 06 2010 - 12:00:05 MST