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

Re: [PATCH 0/6] ISOC23: quell warnings on discarding const

From
D. Ben Knoble <ben.knoble@gmail.com>
Date
Mar 26, 2026, 16:26 UTC
Message-ID
<CALnO6CA0ZfzAk8FU7xOYAW-emLwdVJ9Ed7Vt-77gfuY97FR=1A@mail.gmail.com>
In-Reply-To
<cover.1774537954.git.git@grubix.eu>
On Thu, Mar 26, 2026 at 11:40 AM Michael J Gruber <git@grubix.eu> wrote:
Show 12 quoted lines
>
> Hi there
>
> Fedora 44 beta (gcc-16.0.1, glibc-2.43) brought some fun new warnings
> when building git. In essence, we're not always explicit about
> const-ness or lack thereof of certain pointers. Before, strchr()'s
> signature which turns const arguments into non-const return values
> covered this up. With ISOC23, strchr() and friends return const
> pointers.
>
> This little series takes a middle-ground: no new data types (no new
> const versions of non-const data types) but more explicit casts.

I think a few folks were working on similar things; hopefully I've CC'd some relevant parties.

Show 31 quoted lines
>
> Michael J Gruber (6):
>   do not discard const: the simple cases
>   do not discard const: make git-compat-util ISOC23-like
>   do not discard const: adjust to non-const data types
>   do not discard const: declare const where we stay const
>   do not discard const: keep signature
>   do not discard const: the ugly truth
>
>  builtin/config.c       | 2 +-
>  builtin/receive-pack.c | 6 +++---
>  builtin/rev-parse.c    | 8 ++++----
>  convert.c              | 3 ++-
>  git-compat-util.h      | 2 +-
>  http-push.c            | 2 +-
>  http.c                 | 2 +-
>  pager.c                | 2 +-
>  pseudo-merge.c         | 2 +-
>  range-diff.c           | 2 +-
>  refs/files-backend.c   | 2 +-
>  remote.c               | 2 +-
>  revision.c             | 8 ++++----
>  run-command.c          | 2 +-
>  scalar.c               | 2 +-
>  send-pack.c            | 6 +++---
>  submodule.c            | 2 +-
>  transport-helper.c     | 2 +-
>  18 files changed, 29 insertions(+), 28 deletions(-)
>
> --
> 2.53.0.1195.g771ffcb452
-- 
D. Ben Knoble
Previous: Junio C HamanoNext: Michael J Gruber
Message 23 of 24 in “ISOC23: quell warnings on discarding const”
  1. 0/6 ISOC23: quell warnings on discarding constMichael J Gruber, Mar 26, 2026
  2. 5/6 do not discard const: keep signatureMichael J Gruber, Mar 26, 2026
  3. Junio C HamanoMar 26, 2026
  4. 6/6 do not discard const: the ugly truthMichael J Gruber, Mar 26, 2026
  5. Junio C HamanoMar 26, 2026
  6. Jeff KingMar 26, 2026
  7. 0/4 fix const issues in revision parserJeff King, Mar 26, 2026
  8. 1/4 revision: make handle_dotdot() interface less confusingJeff King, Mar 26, 2026
  9. Junio C HamanoMar 26, 2026
  10. Jeff KingMar 26, 2026
  11. Junio C HamanoMar 27, 2026
  12. 2/4 rev-parse: simplify dotdot parsingJeff King, Mar 26, 2026
  13. 3/4 revision: avoid writing to const string for parent marksJeff King, Mar 26, 2026
  14. 4/4 rev-parse: avoid writing to const string for parent marksJeff King, Mar 26, 2026
  15. 1/6 do not discard const: the simple casesMichael J Gruber, Mar 26, 2026
  16. Jeff KingMar 26, 2026
  17. Junio C HamanoMar 26, 2026
  18. config: store allocated string in non-const pointerJeff King, Mar 26, 2026
  19. 4/6 do not discard const: declare const where we stay constMichael J Gruber, Mar 26, 2026
  20. 2/6 do not discard const: make git-compat-util ISOC23-likeMichael J Gruber, Mar 26, 2026
  21. 3/6 do not discard const: adjust to non-const data typesMichael J Gruber, Mar 26, 2026
  22. Junio C HamanoMar 26, 2026
  23. D. Ben KnobleMar 26, 2026
  24. Michael J GruberMar 27, 2026

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.