#1096710 git: ftbfs with GCC-15

#1096710#5
Date:
2025-02-17 17:15:51 UTC
From:
To:
[This bug is NOT targeted to the upcoming trixie release]

Please keep this issue open in the bug tracker for the package it
was filed for.  If a fix in another package is required, please
file a bug for the other package (or clone), and add a block in this
package. Please keep the issue open until the package can be built in
a follow-up test rebuild.

The package fails to build in a test rebuild on at least amd64 with
gcc-15/g++-15, but succeeds to build with gcc-14/g++-14. The
severity of this report will be raised before the forky release.

The full build log can be found at:
http://qa-logs.debian.net/2025/02/16/amd64exp/git_2.47.2-0.1_unstable_gccexp.log.gz
The last lines of the build log are at the end of this report.

To build with GCC 15, either set CC=gcc-15 CXX=g++-15 explicitly,
or install the gcc, g++, gfortran, ... packages from experimental.

  apt-get -t=experimental install g++

GCC 15 now defaults to the C23/C++23 standards, exposing many FTBFS.
Other Common build failures are new warnings resulting in build failures
with -Werror turned on, or new/dropped symbols in Debian symbols files.
For other C/C++ related build failures see the porting guide at
http://gcc.gnu.org/gcc-15/porting_to.html

[...]
make[2]: Entering directory '/build/reproducible-path/git-2.47.2'
gcc -o rebase.o -c -MF ./.depend/rebase.o.d -MQ rebase.o -MMD -MP   -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/git-2.47.2=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2  -I. -DHAVE_SYSINFO -DGIT_HOST_CPU="\"x86_64\"" -DUSE_LIBPCRE2 -DHAVE_ALLOCA_H  -DUSE_CURL_FOR_IMAP_SEND -DNO_OPENSSL -DSUPPORTS_SIMPLE_IPC -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"git-compat-util.h\"" -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\"" -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC -DHAVE_SYNC_FILE_RANGE -DHAVE_GETDELIM '-DPROCFS_EXECUTABLE_PATH="/proc/self/exe"' -DFREAD_READS_DIRECTORIES -DNO_STRLCPY -DDEFAULT_EDITOR='"editor"' -DDEFAULT_PAGER='"pager"' -DSHELL_PATH='"/bin/sh"'  rebase.c
make[2]: Leaving directory '/build/reproducible-path/git-2.47.2'
make[2]: Entering directory '/build/reproducible-path/git-2.47.2'
gcc -o reachable.o -c -MF ./.depend/reachable.o.d -MQ reachable.o -MMD -MP   -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/git-2.47.2=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2  -I. -DHAVE_SYSINFO -DGIT_HOST_CPU="\"x86_64\"" -DUSE_LIBPCRE2 -DHAVE_ALLOCA_H  -DUSE_CURL_FOR_IMAP_SEND -DNO_OPENSSL -DSUPPORTS_SIMPLE_IPC -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"git-compat-util.h\"" -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\"" -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC -DHAVE_SYNC_FILE_RANGE -DHAVE_GETDELIM '-DPROCFS_EXECUTABLE_PATH="/proc/self/exe"' -DFREAD_READS_DIRECTORIES -DNO_STRLCPY -DDEFAULT_EDITOR='"editor"' -DDEFAULT_PAGER='"pager"' -DSHELL_PATH='"/bin/sh"'  reachable.c
make[2]: Leaving directory '/build/reproducible-path/git-2.47.2'
make[2]: Entering directory '/build/reproducible-path/git-2.47.2'
gcc -o rebase-interactive.o -c -MF ./.depend/rebase-interactive.o.d -MQ rebase-interactive.o -MMD -MP   -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/git-2.47.2=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2  -I. -DHAVE_SYSINFO -DGIT_HOST_CPU="\"x86_64\"" -DUSE_LIBPCRE2 -DHAVE_ALLOCA_H  -DUSE_CURL_FOR_IMAP_SEND -DNO_OPENSSL -DSUPPORTS_SIMPLE_IPC -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"git-compat-util.h\"" -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\"" -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC -DHAVE_SYNC_FILE_RANGE -DHAVE_GETDELIM '-DPROCFS_EXECUTABLE_PATH="/proc/self/exe"' -DFREAD_READS_DIRECTORIES -DNO_STRLCPY -DDEFAULT_EDITOR='"editor"' -DDEFAULT_PAGER='"pager"' -DSHELL_PATH='"/bin/sh"'  rebase-interactive.c
make[2]: Leaving directory '/build/reproducible-path/git-2.47.2'
make[2]: Entering directory '/build/reproducible-path/git-2.47.2'
gcc -o reflog.o -c -MF ./.depend/reflog.o.d -MQ reflog.o -MMD -MP   -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/git-2.47.2=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2  -I. -DHAVE_SYSINFO -DGIT_HOST_CPU="\"x86_64\"" -DUSE_LIBPCRE2 -DHAVE_ALLOCA_H  -DUSE_CURL_FOR_IMAP_SEND -DNO_OPENSSL -DSUPPORTS_SIMPLE_IPC -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"git-compat-util.h\"" -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\"" -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC -DHAVE_SYNC_FILE_RANGE -DHAVE_GETDELIM '-DPROCFS_EXECUTABLE_PATH="/proc/self/exe"' -DFREAD_READS_DIRECTORIES -DNO_STRLCPY -DDEFAULT_EDITOR='"editor"' -DDEFAULT_PAGER='"pager"' -DSHELL_PATH='"/bin/sh"'  reflog.c
reflog.c:213:104: error: macro ‘unreachable’ passed 3 arguments, but takes just 0
  213 | static int unreachable(struct expire_reflog_policy_cb *cb, struct commit *commit, struct object_id *oid)
      |                                                                                                        ^
In file included from /usr/include/sched.h:29,
                 from /usr/include/pthread.h:22,
                 from thread-utils.h:5,
                 from object-store-ll.h:7,
                 from reflog.c:5:
/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:456:9: note: macro ‘unreachable’ defined here
  456 | #define unreachable() (__builtin_unreachable ())
      |         ^~~~~~~~~~~
reflog.c:214:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
  214 | {
      | ^
reflog.c: In function ‘should_expire_reflog_ent’:
reflog.c:268:61: error: macro ‘unreachable’ passed 3 arguments, but takes just 0
  268 |                         if (unreachable(cb, old_commit, ooid) || unreachable(cb, new_commit, noid))
      |                                                             ^
/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:456:9: note: macro ‘unreachable’ defined here
  456 | #define unreachable() (__builtin_unreachable ())
      |         ^~~~~~~~~~~
reflog.c:268:29: error: ‘unreachable’ undeclared (first use in this function); did you mean ‘mark_reachable’?
  268 |                         if (unreachable(cb, old_commit, ooid) || unreachable(cb, new_commit, noid))
      |                             ^~~~~~~~~~~
      |                             mark_reachable
reflog.c:268:29: note: each undeclared identifier is reported only once for each function it appears in
reflog.c:268:98: error: macro ‘unreachable’ passed 3 arguments, but takes just 0
  268 |                         if (unreachable(cb, old_commit, ooid) || unreachable(cb, new_commit, noid))
      |                                                                                                  ^
/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:456:9: note: macro ‘unreachable’ defined here
  456 | #define unreachable() (__builtin_unreachable ())
      |         ^~~~~~~~~~~
make[2]: *** [Makefile:2795: reflog.o] Error 1
make[2]: Leaving directory '/build/reproducible-path/git-2.47.2'
make[2]: *** Waiting for unfinished jobs....
make[2]: Entering directory '/build/reproducible-path/git-2.47.2'
gcc -o reflog-walk.o -c -MF ./.depend/reflog-walk.o.d -MQ reflog-walk.o -MMD -MP   -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/git-2.47.2=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2  -I. -DHAVE_SYSINFO -DGIT_HOST_CPU="\"x86_64\"" -DUSE_LIBPCRE2 -DHAVE_ALLOCA_H  -DUSE_CURL_FOR_IMAP_SEND -DNO_OPENSSL -DSUPPORTS_SIMPLE_IPC -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"git-compat-util.h\"" -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\"" -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC -DHAVE_SYNC_FILE_RANGE -DHAVE_GETDELIM '-DPROCFS_EXECUTABLE_PATH="/proc/self/exe"' -DFREAD_READS_DIRECTORIES -DNO_STRLCPY -DDEFAULT_EDITOR='"editor"' -DDEFAULT_PAGER='"pager"' -DSHELL_PATH='"/bin/sh"'  reflog-walk.c
make[2]: Leaving directory '/build/reproducible-path/git-2.47.2'
make[2]: Entering directory '/build/reproducible-path/git-2.47.2'
gcc -o quote.o -c -MF ./.depend/quote.o.d -MQ quote.o -MMD -MP   -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/git-2.47.2=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2  -I. -DHAVE_SYSINFO -DGIT_HOST_CPU="\"x86_64\"" -DUSE_LIBPCRE2 -DHAVE_ALLOCA_H  -DUSE_CURL_FOR_IMAP_SEND -DNO_OPENSSL -DSUPPORTS_SIMPLE_IPC -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"git-compat-util.h\"" -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\"" -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC -DHAVE_SYNC_FILE_RANGE -DHAVE_GETDELIM '-DPROCFS_EXECUTABLE_PATH="/proc/self/exe"' -DFREAD_READS_DIRECTORIES -DNO_STRLCPY -DDEFAULT_EDITOR='"editor"' -DDEFAULT_PAGER='"pager"' -DSHELL_PATH='"/bin/sh"'  quote.c
make[2]: Leaving directory '/build/reproducible-path/git-2.47.2'
make[2]: Entering directory '/build/reproducible-path/git-2.47.2'
gcc -o range-diff.o -c -MF ./.depend/range-diff.o.d -MQ range-diff.o -MMD -MP   -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/git-2.47.2=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2  -I. -DHAVE_SYSINFO -DGIT_HOST_CPU="\"x86_64\"" -DUSE_LIBPCRE2 -DHAVE_ALLOCA_H  -DUSE_CURL_FOR_IMAP_SEND -DNO_OPENSSL -DSUPPORTS_SIMPLE_IPC -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"git-compat-util.h\"" -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\"" -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC -DHAVE_SYNC_FILE_RANGE -DHAVE_GETDELIM '-DPROCFS_EXECUTABLE_PATH="/proc/self/exe"' -DFREAD_READS_DIRECTORIES -DNO_STRLCPY -DDEFAULT_EDITOR='"editor"' -DDEFAULT_PAGER='"pager"' -DSHELL_PATH='"/bin/sh"'  range-diff.c
make[2]: Leaving directory '/build/reproducible-path/git-2.47.2'
make[2]: Entering directory '/build/reproducible-path/git-2.47.2'
gcc -o pseudo-merge.o -c -MF ./.depend/pseudo-merge.o.d -MQ pseudo-merge.o -MMD -MP   -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/git-2.47.2=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2  -I. -DHAVE_SYSINFO -DGIT_HOST_CPU="\"x86_64\"" -DUSE_LIBPCRE2 -DHAVE_ALLOCA_H  -DUSE_CURL_FOR_IMAP_SEND -DNO_OPENSSL -DSUPPORTS_SIMPLE_IPC -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"git-compat-util.h\"" -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\"" -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC -DHAVE_SYNC_FILE_RANGE -DHAVE_GETDELIM '-DPROCFS_EXECUTABLE_PATH="/proc/self/exe"' -DFREAD_READS_DIRECTORIES -DNO_STRLCPY -DDEFAULT_EDITOR='"editor"' -DDEFAULT_PAGER='"pager"' -DSHELL_PATH='"/bin/sh"'  pseudo-merge.c
make[2]: Leaving directory '/build/reproducible-path/git-2.47.2'
make[2]: Entering directory '/build/reproducible-path/git-2.47.2'
gcc -o pretty.o -c -MF ./.depend/pretty.o.d -MQ pretty.o -MMD -MP   -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/git-2.47.2=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2  -I. -DHAVE_SYSINFO -DGIT_HOST_CPU="\"x86_64\"" -DUSE_LIBPCRE2 -DHAVE_ALLOCA_H  -DUSE_CURL_FOR_IMAP_SEND -DNO_OPENSSL -DSUPPORTS_SIMPLE_IPC -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"git-compat-util.h\"" -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\"" -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC -DHAVE_SYNC_FILE_RANGE -DHAVE_GETDELIM '-DPROCFS_EXECUTABLE_PATH="/proc/self/exe"' -DFREAD_READS_DIRECTORIES -DNO_STRLCPY -DDEFAULT_EDITOR='"editor"' -DDEFAULT_PAGER='"pager"' -DSHELL_PATH='"/bin/sh"'  pretty.c
make[2]: Leaving directory '/build/reproducible-path/git-2.47.2'
make[2]: Entering directory '/build/reproducible-path/git-2.47.2'
gcc -o read-cache.o -c -MF ./.depend/read-cache.o.d -MQ read-cache.o -MMD -MP   -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/git-2.47.2=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2  -I. -DHAVE_SYSINFO -DGIT_HOST_CPU="\"x86_64\"" -DUSE_LIBPCRE2 -DHAVE_ALLOCA_H  -DUSE_CURL_FOR_IMAP_SEND -DNO_OPENSSL -DSUPPORTS_SIMPLE_IPC -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"git-compat-util.h\"" -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\"" -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC -DHAVE_SYNC_FILE_RANGE -DHAVE_GETDELIM '-DPROCFS_EXECUTABLE_PATH="/proc/self/exe"' -DFREAD_READS_DIRECTORIES -DNO_STRLCPY -DDEFAULT_EDITOR='"editor"' -DDEFAULT_PAGER='"pager"' -DSHELL_PATH='"/bin/sh"'  read-cache.c
make[2]: Leaving directory '/build/reproducible-path/git-2.47.2'
make[2]: Entering directory '/build/reproducible-path/git-2.47.2'
gcc -o ref-filter.o -c -MF ./.depend/ref-filter.o.d -MQ ref-filter.o -MMD -MP   -Wdate-time -D_FORTIFY_SOURCE=2 -Wall -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/git-2.47.2=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2  -I. -DHAVE_SYSINFO -DGIT_HOST_CPU="\"x86_64\"" -DUSE_LIBPCRE2 -DHAVE_ALLOCA_H  -DUSE_CURL_FOR_IMAP_SEND -DNO_OPENSSL -DSUPPORTS_SIMPLE_IPC -DSHA1_DC -DSHA1DC_NO_STANDARD_INCLUDES -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"git-compat-util.h\"" -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\"" -DSHA256_BLK  -DHAVE_PATHS_H -DHAVE_DEV_TTY -DHAVE_CLOCK_GETTIME -DHAVE_CLOCK_MONOTONIC -DHAVE_SYNC_FILE_RANGE -DHAVE_GETDELIM '-DPROCFS_EXECUTABLE_PATH="/proc/self/exe"' -DFREAD_READS_DIRECTORIES -DNO_STRLCPY -DDEFAULT_EDITOR='"editor"' -DDEFAULT_PAGER='"pager"' -DSHELL_PATH='"/bin/sh"'  ref-filter.c
make[2]: Leaving directory '/build/reproducible-path/git-2.47.2'
make[1]: *** [debian/rules:62: build-stamp] Error 2
make: *** [debian/rules:56: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2