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

Re: [PATCH] Makefile: make COMPUTE_HEADER_DEPENDENCIES=auto work with DEVOPTS=pedantic

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Sep 22, 2021, 19:45 UTC
Message-ID
<87fstw75iv.fsf@evledraar.gmail.com>
In-Reply-To
<xmqqmto48ufz.fsf@gitster.g>
On Wed, Sep 22 2021, Junio C Hamano wrote:
Show 13 quoted lines
> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
>
>> The "COMPUTE_HEADER_DEPENDENCIES" feature added in [1] was extended to
>> use auto-detection in [2]. Then when -Wpedantic support was added to
>> DEVOPTS in [3] we started passing -Wpedantic in combination with
>> -Werror to the compiler here.
>>
>> This broke the auto-detection, but since we'd quieted it in [4] we
>> didn't find out.
>
> Are the references correct?  I am not seeing "quiet"ing in [4].  The
> redirection 2>&1 to cram error messages also to $(dep_check), hence
> making it impossible to match '0', was done in [2].

Yes it's incorrect, I meant [2]. I had this right in my head, just got the references wrong somehow,thanks.

> We did make the pedantic mode the default and pass both -pedantic
> and -Wpedantic after [4].  Before we had only -pedantic.
*nod*
Show 25 quoted lines
>> It was emitting all of this on STDERR under GCC:
>>
>>     /dev/null:1: error: ISO C forbids an empty translation unit
>>     [-Werror=pedantic]
>>     cc1: note: unrecognized command-line option
>>     ‘-Wno-pedantic-ms-format’ may have been intended to silence
>>     earlier diagnostics
>>     cc1: all warnings being treated as errors
>>
>> Let's fix that bug by maintaining a NON_DEVELOPER_CFLAGS, it's like
>> ALL_CFLAGS but without anything we add in config.mak.dev, and
>> furthermore stop redirecting STDERR to /dev/null, this means that
>> someone whose compiler doesn't support this will see this output, but
>> also this new message:
>>
>>     Non-zero 1 exit with COMPUTE_HEADER_DEPENDENCIES=auto, set it to "yes" or "no" to quiet auto-detect
>
>
> Hmmmmmph.  
>
> I recentaly saw many .depend directories (not necessarily empty)
> left after "make distclean". After building on one branch, I often
> check out a different branch then run distclean on the new branch,
> so leftover build artifacts are not necessarily a bug in our
> Makefile, but the bug you found may explain it?

Yes, I'll update the commit message, the problem is that we'll empty the dep_dirs list if we're not *currently* making them, that's a logic error in a few places in the Makefile, i.e. conflating currently building X with wanting to clean X.

[Will respond to the rest with a re-roll and/or in other replies in-thread]
Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 15 of 21 in “Makefile: make COMPUTE_HEADER_DEPENDENCIES=auto work with DEVOPTS=pedantic”
  1. Makefile: make COMPUTE_HEADER_DEPENDENCIES=auto work with DEVOPTS=pedanticÆvar Arnfjörð Bjarmason, Sep 22, 2021
  2. Carlo ArenasSep 22, 2021
  3. Ævar Arnfjörð BjarmasonSep 22, 2021
  4. Junio C HamanoSep 22, 2021
  5. Jeff KingSep 22, 2021
  6. Junio C HamanoSep 22, 2021
  7. Carlo ArenasSep 22, 2021
  8. Jeff KingSep 22, 2021
  9. Carlo ArenasSep 22, 2021
  10. Ævar Arnfjörð BjarmasonSep 22, 2021
  11. Jeff KingSep 23, 2021
  12. Junio C HamanoSep 23, 2021
  13. Jeff KingSep 23, 2021
  14. Junio C HamanoSep 23, 2021
  15. Ævar Arnfjörð BjarmasonSep 22, 2021
  16. 0/2 Makefile: "pedantic" fallout on .depend and "compdb"Ævar Arnfjörð Bjarmason, Sep 22, 2021
  17. 1/2 Makefile: make COMPUTE_HEADER_DEPENDENCIES=auto work with DEVOPTS=pedanticÆvar Arnfjörð Bjarmason, Sep 22, 2021
  18. 2/2 Makefile: pass -Wno-pendantic under GENERATE_COMPILATION_DATABASE=yesÆvar Arnfjörð Bjarmason, Sep 22, 2021
  19. Carlo ArenasSep 23, 2021
  20. Junio C HamanoSep 23, 2021
  21. Jeff KingSep 23, 2021

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.