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

Re: [PATCH v5] compat: auto-detect if zlib has uncompress2()

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jan 25, 2022, 19:12 UTC
Message-ID
<220125.86wninfwyc.gmgdl@evledraar.gmail.com>
In-Reply-To
<xmqqlez43mx1.fsf@gitster.g>
On Mon, Jan 24 2022, Junio C Hamano wrote:
Show 13 quoted lines
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>> Aside: I have not yet found such a compiler, does anyone know of one
>> that breaks? In any case doing this for good measure seems fine, just
>> wondering if we're cargo-culting a needless workaround or not.
>
> Before I started Git, I had to deal with quite a many variations of
> UNIX, all of which looked alike but behaved slightly differently,
> and I do recall seeing this exact breakage, so it is a real solution
> to a real problem, and I can see OpenSSL folks had seen the same one.
>
> If you find my experience is not Enough, I have no further words for
> you on this topic.

I wasn't alleging that this issue was a figment of someone's imagination, but probing for whether it was a current issue or not. I.e. it could have been something that only mattered in the GCC 2.x era, and OpenSSL was still carrying.

But as Carlo notes downthread it's to do with ISO C strictness and -Wempty-translation-unit. So we'd have caught it under DEVELOPER=1, but due to the recent over-strictness of DEVELOPER I'd disabled it on the test boxes involved, so I didn't spot that.

> If the question is "name a compiler that breaks and is *still* in
> active use", then the answer would be fuzzy (it depends on the
> definition of "in active use"), but is useful to find out.
But as to how to deal with it this is good enough for now, but perhaps
we'll consider something like this for a future compat/*.c addition:
    
    $ file compat/blah.c
    compat/blah.c: empty
    $ diff --git a/Makefile b/Makefile
    index 5da099e8a16..62ec13c72fd 100644
    --- a/Makefile
    +++ b/Makefile
    @@ -571 +571 @@ COMPAT_CFLAGS =
    -COMPAT_OBJS =
    +COMPAT_OBJS = compat/blah.o
    @@ -2604,0 +2605 @@ endif
    +compat/blah.o: EXTRA_CPPFLAGS += -Wno-empty-translation-unit

That will compile cleanly on GCC and Clang with DEVELOPER=1, which of course may leave some other strictly ISO C compiler unsatisfied.

Previous: Junio C HamanoNext: Junio C Hamano
Message 21 of 22 in “cache.h: auto-detect if zlib has uncompress2()”
  1. cache.h: auto-detect if zlib has uncompress2()Ævar Arnfjörð Bjarmason, Jan 17, 2022
  2. Junio C HamanoJan 17, 2022
  3. rsbecker@nexbridge.comJan 17, 2022
  4. René ScharfeJan 17, 2022
  5. Carlo ArenasJan 20, 2022
  6. cache.h: auto-detect if zlib has uncompress2()Ævar Arnfjörð Bjarmason, Jan 19, 2022
  7. Junio C HamanoJan 19, 2022
  8. cache.h: auto-detect if zlib has uncompress2()Ævar Arnfjörð Bjarmason, Jan 20, 2022
  9. Junio C HamanoJan 21, 2022
  10. rsbecker@nexbridge.comJan 21, 2022
  11. Junio C HamanoJan 22, 2022
  12. Beat BolliJan 23, 2022
  13. Junio C HamanoJan 23, 2022
  14. compat: auto-detect if zlib has uncompress2()Junio C Hamano, Jan 24, 2022
  15. Ævar Arnfjörð BjarmasonJan 24, 2022
  16. compat: auto-detect if zlib has uncompress2()Junio C Hamano, Jan 24, 2022
  17. Ævar Arnfjörð BjarmasonJan 24, 2022
  18. Junio C HamanoJan 24, 2022
  19. Carlo ArenasJan 25, 2022
  20. Junio C HamanoJan 25, 2022
  21. Ævar Arnfjörð BjarmasonJan 25, 2022
  22. Junio C HamanoJan 26, 2022

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.