Re: [PATCH 0/9] Add missing includes and forward declares

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

 



Jeff King wrote:
> On Mon, Aug 13, 2018 at 11:24:37AM -0700, Junio C Hamano wrote:
>> Jeff King wrote:

>>> So I think the better test is a two-line .c file with:
>>>
>>>   #include "git-compat-util.h"
>>>   #include $header_to_check
>>
>> But until that tightening happens, I do not actually mind the
>> two-line .c file started with inclusion of cache.h instead of
>> git-compat-util.h.  That would limit the scope of this series
>> further.
>
> I can go either way on this. Using cache.h makes Elijah's current series
> a bit more focused. But I think we'd eventually want to go there anyway.
> I don't have a strong opinion on doing it now or later.

For what it's worth, I'd been assuming that any header that is not
self-contained after a #include of "git-compat-util.h" is a bug.

It's true that many .c files include git-compat-util.h via cache.h,
making such a bug harder to notice.  But the moment you write a source
file that doesn't include cache.h you'd run into that problem, so it's
worth fixing ahead-of-time anyway.

Thanks,
Jonathan



[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