Re: [PATCH] Makefile: drop GEN_HDRS

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

 



On Mon, Dec 16, 2019 at 05:43:21PM -0800, Jonathan Nieder wrote:

> Jeff King wrote:
> 
> > I actually wonder if the whole thing would be simpler if command-list.h
> > was a static tracked file with the declarations, and we generated
> > command-list.c with "extern const char *command_list[]", etc.
> 
> Right, or a "command-list.inc" file.
> 
> extern-ing it seems like the simplest way to go.

If only. I took a brief look at this. Besides the Makefile chaos (did
you know that the vcxproj rule manually builds and git-adds
command-list.h? No idea what is going on there), it looks like we
dynamically generate the category bitfield, which is then used directly
in help.c. We _could_ declare those bitfields as externs themselves, but
part of the point is that the full list of categories is generated
dynamically from command-list.txt.

So we'd either split the list into two (one list of categories special
enough to be manually declared, and the rest that get generated
automatically) or we'd end up just duplicating the whole list.

Certainly this could all be untangled, but given that the system is
working just fine as it is, it doesn't seem worth anybody's time (and
the risk of weird follow-on problems) to adjust it.

-Peff



[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