worldforge/cyphesis — comment on commit d1ac1ad740656e2ecb6411fd25f1aae6fc2c2720
File:  line 0
By alriddoch:

On 21 December 2011 07:58, Erik Ogenvik

wrote:
> I've looked at some tools for automatically finding unused includes. But so far haven't had any luck with successfully running them. Have you any experience?
>

Nope. I've thought about the problem, and concluded that given the
lack of constraints on what could be in a header, it would be
essentially impossible to analyze the code in any simple way. The only
approach I could think of was one where a tool tried removing each
include in turn and seeing if the code compiles, and this does not
take into account cases where the code still compiles, but generates
different code if a header is missing, such as the case of "config.h"
in many codebases.

I do this kind of cleanup hacking when I am energetic, but in a poor
environment for concentration such as traveling by train.

Al
--
Alistair Riddoch
alriddoch@googlemail.com
http://alistairriddoch.org/