On Thu, Aug 16, 2018 at 01:19:17AM +0100, Ramsay Jones wrote:
> As a quick ("just before bedtime") exercise, I tried adding
> a Makefile target to perform a similar check. The result is
> given below, but I haven't had time to look too closely at
> the results:
The resulting patch doesn't look too horrible, and I think it would be
great to automate this, even if people don't always run it by default.
The flip side is the "do all files include git-compat-util.h first" test
I mentioned elsewhere (and which resulted in the test-tool.h patch).
That could be automated, too. I did it like:
{
echo '#undef int'
cat git-compat-util.h
} >tmp
mv tmp git-compat-util.h
make CFLAGS=-Dint=foo
That's obviously pretty nasty, but if we were willing to carry:
#ifdef UNDO_TRICKY_LINT_HACK
#undef int
#endif
in git-compat-util.h, it could be driven from the Makefile. Maybe
worth-while to couple with this.
-Peff