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

Re: [RFC PATCH v5 0/8] rebase-interactive

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 26, 2018, 15:56 UTC
Message-ID
<xmqqzi2ude4w.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CAKk8ispSgNgZxS7KfuOyxfU53tzesvNyLRaNXFZa3K7SCbaRkQ@mail.gmail.com>
Wink Saville <wink@saville.com> writes:
Show 15 quoted lines
> json-writer.c:123:38:  error:  format specifies type 'uintmax_t' (aka
> 'unsigned long') but the argument has type 'uint64_t' (aka 'unsigned
> long long') [-Werror,-Wformat]
>
>         strbuf_addf(&jw->json, ":%"PRIuMAX, value);
>                                  ~~         ^~~~~
> json-writer.c:228:37:  error:  format specifies type 'uintmax_t' (aka
> 'unsigned long') but the argument has type 'uint64_t' (aka 'unsigned
> long long') [-Werror,-Wformat] [0m
>
>         strbuf_addf(&jw->json, "%"PRIuMAX, value);
>                                  ~~         ^~~~~
> 2 errors generated.
> make: *** [json-writer.o] Error 1
> make: *** Waiting for unfinished jobs....

For whatever reason, our codebase seems to shy away from PRIu64, even though there are liberal uses of PRIu32. Showing the value casted to uintmax_t with PRIuMAX seems to be our preferred way to say "We cannot say how wide this type is on different platforms, and are playing safe by using widest-possible int type" (e.g. showing a pid_t value from daemon.c).

In this codepath, the actual values are specified to be uint64_t, so the use of PRIu64 may be OK, but I have to wonder why the codepath is not dealing with uintmax_t in the first place. When even larger than present archs are prevalent in N years and 64-bit starts to feel a tad small (like we feel for 16-bit ints these days), it will feel a bit silly to have a subsystem that is limited to such a "fixed and a tad small these days" types and pretend it to be be a generic seriealizer, I suspect.

Previous: Wink SavilleNext: Jeff Hostetler
Message 31 of 42 in “rebase-interactive”
  1. rebase-interactiveWink Saville, Mar 23, 2018
  2. rebase-interactive: Simplify pick_on_preserving_mergesWink Saville, Mar 23, 2018
  3. Johannes SchindelinMar 23, 2018
  4. rebase: Update invocation of rebase dot-sourced scriptsWink Saville, Mar 23, 2018
  5. Eric SunshineMar 23, 2018
  6. Junio C HamanoMar 23, 2018
  7. Eric SunshineMar 23, 2018
  8. Johannes SchindelinMar 23, 2018
  9. Wink SavilleMar 23, 2018
  10. Junio C HamanoMar 23, 2018
  11. Wink SavilleMar 23, 2018
  12. 0/8 rebase-interactiveWink Saville, Mar 23, 2018
  13. 1/8 rebase-interactive: simplify pick_on_preserving_mergesWink Saville, Mar 23, 2018
  14. 2/8 rebase: update invocation of rebase dot-sourced scriptsWink Saville, Mar 23, 2018
  15. 3/8 Indent function git_rebase__interactiveWink Saville, Mar 23, 2018
  16. Junio C HamanoMar 23, 2018
  17. Wink SavilleMar 23, 2018
  18. Junio C HamanoMar 23, 2018
  19. Wink SavilleMar 24, 2018
  20. 4/8 Extract functions out of git_rebase__interactiveWink Saville, Mar 23, 2018
  21. Junio C HamanoMar 23, 2018
  22. Eric SunshineMar 24, 2018
  23. 5/8 Add and use git_rebase__interactive__preserve_mergesWink Saville, Mar 23, 2018
  24. 6/8 Remove unused code paths from git_rebase__interactiveWink Saville, Mar 23, 2018
  25. 7/8 Remove unused code paths from git_rebase__interactive__preserve_mergesWink Saville, Mar 23, 2018
  26. 8/8 Remove merges_option and a blank lineWink Saville, Mar 23, 2018
  27. Wink SavilleMar 23, 2018
  28. Junio C HamanoMar 23, 2018
  29. Wink SavilleMar 23, 2018
  30. Wink SavilleMar 24, 2018
  31. Junio C HamanoMar 26, 2018
  32. Jeff HostetlerMar 26, 2018
  33. Junio C HamanoMar 26, 2018
  34. Jeff HostetlerMar 26, 2018
  35. Junio C HamanoMar 27, 2018
  36. Jeff HostetlerMar 27, 2018
  37. Junio C HamanoMar 26, 2018
  38. Jeff HostetlerMar 26, 2018
  39. Wink SavilleMar 26, 2018
  40. Junio C HamanoMar 26, 2018
  41. Johannes SchindelinMar 26, 2018
  42. Junio C HamanoMar 23, 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.