Re: Feature branch launched: deheader

From: Kinkie <gkinkie_at_gmail.com>
Date: Sun, 5 Dec 2010 19:58:16 +0100

On Sun, Dec 5, 2010 at 7:48 PM, Robert Collins
<robertc_at_robertcollins.net> wrote:
> On Mon, Dec 6, 2010 at 3:28 AM, 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.
>
> Thats a fairly flawed approach.
>
> Two reasons:
>  - some headers when present affect correctness, not compilation.
>  - on some platforms headers are mandatory, on others optional.
>
> So, if you do this, be sure to take the minimal approach after
> building on *all* platforms, and then still be conservative.

I agree
To address those issues I'm focusing on squid internal headers, and in
most cases only turning includes for squid.h into includes for
config.h. I'm relying on a matrix build to track system dependencies,
and on unit tests to catch correctness issues. On the plus side, this
effort involves massive amounts of cpu power and elapsed-time but not
as much brainpower, so if it all is for nothing, it won't be a big
waste.

-- 
    /kinkie
Received on Sun Dec 05 2010 - 18:58:24 MST

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