Mathiasdm/cdt — Issue #4: Check for unused and transitive header includes
Author: Mathiasdm
Created: 2011-11-20 12:23:44+00:00
State: open

C and C++ make it very easy to add new header includes, but also to build up a huge include structure.
Including a single header can in fact result in hundreds of headers being added to the source code (even though only a few headers are used).

A first issue is transitive header includes.
You include header A, header A includes header B, and in fact, you only need header B. This is a so-called 'transitive header include'. It could be fixed by removing the include of A and adding an include of B.

A second issue is useless header includes. Often headers are added at some point during the project. As the source code changes, these headers might not be needed anymore.