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

Re: [PATCH v3] cache.h: auto-detect if zlib has uncompress2()

From
Beat Bolli <dev+git@drbeat.li>
Date
Jan 23, 2022, 00:19 UTC
Message-ID
<74d35354-20a6-9cc1-3452-573460c694bd@drbeat.li>
In-Reply-To
<xmqqr190ekrh.fsf@gitster.g>
On 22.01.22 00:23, Junio C Hamano wrote:
Show 12 quoted lines
> Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
> 
>> As noted in the updated commit message this approach of having an
>> object just for this fallback function comes at the cost of some
>> complexity, but now the compat object lives neatly in its own object.
> 
> I do not see any change in this patch adding costly complexity, but
> I notice lack of one possible trick that might become problem with
> some compilers and linkers when their zlib has uncompress2()
> function.  Let's have this graduate very early in the next cycle, to
> see if anybody on a rarer system sees a complaint due to having to
> deal with a totally empty object file.
OpenSSL has a macro in include/openssl/macros.h to counteract exactly this:
     /*
      * Sometimes OPENSSL_NO_xxx ends up with an empty file and some 
compilers
      * don't like that.  This will hopefully silence them.
      */
     #define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy;

They insert it in the otherwise empty "#else" branch of conditionally complied code.

Cheers, Beat
Previous: Junio C HamanoNext: Junio C Hamano
Message 12 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.