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

Build failure with -std=gnu23 (GCC 15 default)

From
Sam James <sam@gentoo.org>
Date
Nov 16, 2024, 23:18 UTC
Message-ID
<87ed3apy2u.fsf@gentoo.org>
Hi,
Upcoming GCC 15 defaults to -std=gnu23. git-2.47.0 fails to build as
follows:
```
builtin/index-pack.c:97:8: error: expected ‘{’ before ‘thread_local’
   97 | struct thread_local {
      |        ^~~~~~~~~~~~
builtin/index-pack.c:120:15: error: expected ‘{’ before ‘thread_local’
  120 | static struct thread_local nothread_data;
      |               ^~~~~~~~~~~~
builtin/index-pack.c:151:15: error: expected ‘{’ before ‘thread_local’
  151 | static struct thread_local *thread_data;
      |               ^~~~~~~~~~~~
```

There may be more issues, but at the very least thread_local became a proper keyword in C23, so that will need renaming.

It should be possible to reproduce these with older GCC (and Clang) with -std=gnu23 or -std=c23 set manually.

thanks, sam

Next: brian m. carlson
Message 1 of 8 in “Build failure with -std=gnu23 (GCC 15 default)”
  1. Sam JamesNov 16, 2024
  2. 0/2 C23 compatibilitybrian m. carlson, Nov 17, 2024
  3. 2/2 reflog: rename unreachablebrian m. carlson, Nov 17, 2024
  4. 1/2 index-pack: rename struct thread_localbrian m. carlson, Nov 17, 2024
  5. Sam JamesNov 17, 2024
  6. Patrick SteinhardtNov 18, 2024
  7. Jeff KingNov 18, 2024
  8. brian m. carlsonNov 18, 2024

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.