Re: [PATCH 0/5] Header includes cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christian Couder <chriscool@xxxxxxxxxxxxx> writes:

> I think it's a good thing that you started working on it even if in the end 
> we decide that we want these cleanup to be done otherwise. At least we will 
> hopefully have clarified our include header policy.

Before seeing a lot of patches to change #include all over the place, I'd
like to see a simple guiding principle described, not just a subjective "I
think this makes things better" but with "... because of X and Y and Z".

The document Documentation/CodingGuidelines describes the only policy that
exists currently: git-compat-util.h must be the first thing the compiler
sees.  The language should probably be stronger than what appears there:

 - The first #include in C files, except in platform specific
   compat/ implementations, should be git-compat-util.h or another
   well-known header file that includes it at the beginning, namely
   cache.h or builtin.h.

Even though http.h may include "cache.h" at the very beginning, I'd rather
not to see http-walker.c lose inclusion of "cache.h".  It will force us to
remember that http.h is Ok to include as the first file, and that won't
scale.

The reason git-compat-util.h must be the first is because inclusion of all
the system header files is supposed to happen there, and there are some
platforms that have broken system header dependencies we do not want
application writers to care about, and the compat-util header knows about
them.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux