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

Re: [PATCH 6/7] Check if strtoumax is a macro (eg HP-UX 11.11).

From
DTDarren Tucker <dtucker@dtucker.net>
Date
May 20, 2020, 01:49 UTC
Message-ID
<CALDDTe3CBUxEC7E+xc3RhJP45N3v8QXNqt3oq98308x-PJ9r_w@mail.gmail.com>
In-Reply-To
<xmqqo8ql40z7.fsf@gitster.c.googlers.com>

On Tue, 19 May 2020 at 03:17, Junio C Hamano <gitster@pobox.com> wrote: [...]

> It is kind of surprising that we got away with GIT_CHECK_FUNC() that
> misses an implementation by macro without having problems with other
> symbols.

I suspect that in most cases you'll go to the fallback and be fine. In this case, it falls back to strtoull which it doesn't have. (Adding the strtoull test in patch 3/7 makes it fall back to strtoul which it does have).

The other annoyance is that it produces a macro redefinition warning on each file. An alternative solution to that would be to undef strtoumax in git-compat-util.h before redefining it.

Show 5 quoted lines
> I don't mind taking this patch as-is, but it makes me wonder if we
> need to devise a more systematic approach to the issue than "oh, I
> found GIT_CHECK_FUNC() does not work for X on system Y, so let's add
> an AC_CHECK_DECL() for it, too" approach, which this patch is its
> first step.

The caveat with putting it in GIT_CHECK_FUNC() is that you'll need to include the union of all of the header files that might have all of the things you're looking for instead of the hopefully small set of them that might have the one specific thing you're looking for. I suspect that would be more hassle than it's worth.

-- 
Darren Tucker (dtucker at dtucker.net)
GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860  37F4 9357 ECEF 11EA A6FA (new)
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 24 in “Redirect grep's stderr top null too.”
  1. 1/7 Redirect grep's stderr top null too.Darren Tucker, May 18, 2020
  2. 4/7 Use strtoumax instead of strtoull.Darren Tucker, May 18, 2020
  3. Junio C HamanoMay 18, 2020
  4. 5/7 Define LLONG_MAX/MIN etc if not already defined.Darren Tucker, May 18, 2020
  5. Andreas SchwabMay 18, 2020
  6. Darren TuckerMay 18, 2020
  7. 6/7 Check if strtoumax is a macro (eg HP-UX 11.11).Darren Tucker, May 18, 2020
  8. Junio C HamanoMay 18, 2020
  9. Darren TuckerMay 20, 2020
  10. Junio C HamanoMay 20, 2020
  11. 2/7 Define NO_PREAD for HPUX 11.11 and 11.00.Darren Tucker, May 18, 2020
  12. 3/7 Test for strtoull in configure.Darren Tucker, May 18, 2020
  13. 7/7 Define SCNuMAX if not already defined.Darren Tucker, May 18, 2020
  14. Đoàn Trần Công DanhMay 18, 2020
  15. Darren TuckerMay 18, 2020
  16. Đoàn Trần Công DanhMay 18, 2020
  17. Darren TuckerMay 18, 2020
  18. t5703: replace "grep -a" usage by perlĐoàn Trần Công Danh, May 19, 2020
  19. Darren TuckerMay 19, 2020
  20. Christian CouderMay 19, 2020
  21. Đoàn Trần Công DanhMay 19, 2020
  22. Christian CouderMay 19, 2020
  23. Eric SunshineMay 19, 2020
  24. Junio C HamanoMay 18, 2020

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.