Re: Feature branch launched: deheader

From: Robert Collins <robertc_at_robertcollins.net>
Date: Mon, 6 Dec 2010 07:48:48 +1300

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.

-Rob
Received on Sun Dec 05 2010 - 18:48:53 MST

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