git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/9] Makefile: add a hdr-check target

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 20, 2018, 14:26 UTC
Message-ID
<xmqqbm8s2qjd.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<d24df21a-7ab2-84f6-8b18-83fd9c8c2b30@ramsayjones.plus.com>
Ramsay Jones <ramsay@ramsayjones.plus.com> writes:
Show 5 quoted lines
> Commit ef3ca95475 ("Add missing includes and forward declarations",
> 2018-08-15) resulted from the author employing a manual method to
> create a C file consisting of a pair of pre-processor #include
> lines (for 'git-compat-util.h' and a given toplevel header), and
> fixing any resulting compiler errors or warnings.
It makes sense to have tool do what we do not have to do manually.

One thing that makes me wonder with the patch is that the new check command does not seem to need to see what is on CFLAGS and friends. Having seen that "make DEVELOPER=1" adds more -W... on the command line of the compiler and makes a build fail on a source that otherwise would build, I am wondering if there are some (subset of) options that the header-check command line wants to give to the compiler.

Of course, there are also conditionally compiled sections of code, which are affected by the choice of -DMACRO=VALUE; how does this new feature handle that?

Show 5 quoted lines
> Add a Makefile target to automate this process. This implementation
> relies on the '-include' and '-xc' arguments to the 'gcc' and 'clang'
> compilers, which allows us to effectively create the required C
> compilation unit on-the-fly. This limits the portability of this
> solution to those systems which have such a compiler.
Previous: Martin ÅgrenNext: Ramsay Jones
Message 5 of 7 in “Makefile: add a hdr-check target”
  1. 1/9 Makefile: add a hdr-check targetRamsay Jones, Sep 19, 2018
  2. Martin ÅgrenSep 19, 2018
  3. Ramsay JonesSep 19, 2018
  4. Martin ÅgrenSep 20, 2018
  5. Junio C HamanoSep 20, 2018
  6. Ramsay JonesSep 20, 2018
  7. Junio C HamanoSep 20, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.