Re: [PATCHv4 0/6] Add missing includes and forward declares
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 16, 2018, 16:20 UTC
- Message-ID
- <xmqqtvnufflg.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <b8553a50-6b97-2b45-2f7b-cfe2576548cb@ramsayjones.plus.com>
Ramsay Jones <ramsay@ramsayjones.plus.com> writes:
Show 9 quoted lines
> BTW, I happen to be on the 'pu' branch. > > I think some of the errors are due to missing compiler flags > (-I, -D, etc); which flags did you pass to the compiler? > > Well, it killed 15min. before bed! ;-) > > ATB, > Ramsay Jones
It certainly does look fun. I anticipate (read: mostly "hinting that I won't be the one who would be doing so") somebody would make it a real patch, as the current trend seems to be to automate as much checking as we reasonably can.
Show 29 quoted lines
> -- >8 -- > Subject: [PATCH] Makefile: add a hdr-check target > > Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com> > --- > Makefile | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/Makefile b/Makefile > index 9923db888c..798396c52e 100644 > --- a/Makefile > +++ b/Makefile > @@ -2684,6 +2684,16 @@ $(SP_OBJ): %.sp: %.c GIT-CFLAGS FORCE > .PHONY: sparse $(SP_OBJ) > sparse: $(SP_OBJ) > > +EXCEPT_HDRS := ./compat% ./xdiff% ./ewah% > +CHK_HDRS = $(filter-out $(EXCEPT_HDRS),$(LIB_H)) > +HCO = $(patsubst %.h,%.hco,$(CHK_HDRS)) > + > +$(HCO): %.hco: %.h FORCE > + $(CC) -Wall -include git-compat-util.h -I. -o /dev/null -c -xc $< > + > +.PHONY: hdr-check $(HCO) > +hdr-check: $(HCO) > + > .PHONY: style > style: > git clang-format --style file --diff --extensions c,h