Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Re: Unused #include statements

From: Jeff King <hidden>
Date: 2016-06-15 23:03:35

On Thu, Jan 15, 2015 at 05:14:39AM +0100, Robert Schiele wrote:
Thus doing those kind of brute-force removals generally makes the
include structure in a project very fragile. The analysis itself you
did is still useful to identify header files that can potentially be
removed but removing them without further analysis I would consider
problematic.
I would second that. Besides leading to a potentially fragile result,
this analysis was done only for a particular platform with a particular
set of config knobs.

One of our rules is that git-compat-util.h (or one of the well-known
headers which includes, cache.h or builtin.h) is included first in any
translation unit. This gives git-compat-util the cleanest environment
possible for making decisions, and lets macros it defines effect the
rest of the code consistently. I suspect on modern platforms like
Linux/glibc that it is not a huge deal to include git-compat-util a
little late, simply because it does not have all that much to do. But
on Solaris 8? Who knows.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help