#1097785 regina-rexx: ftbfs with GCC-15

Package:
src:regina-rexx
Source:
src:regina-rexx
Submitter:
Matthias Klose
Date:
2025-09-07 09:05:02 UTC
Severity:
normal
Tags:
#1097785#5
Date:
2025-02-17 17:50:15 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/regina-rexx_3.9.5+dfsg1-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

[...]
./builtin.c:1280:24: warning: ‘%d’ directive writing between 1 and 11 bytes into a region of size 4 [-Wformat-overflow=]
 1280 |          answer->len = sprintf( answer->value, "%d", tmdata.tm_yday + 1 );
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./builtin.c:1280:24: note: directive argument in the range [-2147483647, 2147483647]
In function ‘sprintf’,
    inlined from ‘__regina_std_date’ at ./builtin.c:1280:24:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:30:10: note: ‘__builtin___sprintf_chk’ output between 2 and 12 bytes into a destination of size 4
   30 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   31 |                                   __glibc_objsize (__s), __fmt,
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   32 |                                   __va_arg_pack ());
      |                                   ~~~~~~~~~~~~~~~~~
./builtin.c: In function ‘__regina_std_date’:
./builtin.c:1277:24: warning: ‘%d’ directive writing between 1 and 11 bytes into a region of size 4 [-Wformat-overflow=]
 1277 |          answer->len = sprintf( answer->value, "%d", length-basedays( (tmdata.tm_year/100)*100)+1 ); /* bja */
      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./builtin.c:1277:24: note: directive argument in the range [-2147483647, 2147483647]
In function ‘sprintf’,
    inlined from ‘__regina_std_date’ at ./builtin.c:1277:24:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:30:10: note: ‘__builtin___sprintf_chk’ output between 2 and 12 bytes into a destination of size 4
   30 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   31 |                                   __glibc_objsize (__s), __fmt,
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   32 |                                   __va_arg_pack ());
      |                                   ~~~~~~~~~~~~~~~~~
x86_64-linux-gnu-gcc -DNDEBUG -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/regina-rexx-3.9.5+dfsg1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -DREGINA_SHARE_DIRECTORY=\"/usr/share/regina-rexx\" -funsigned-char -DREGINA_VERSION_DATE=\""25 Jun 2022"\" -DREGINA_VERSION_MAJOR=\"3\" -DREGINA_VERSION_MINOR=\"9\" -DREGINA_VERSION_RELEASE=\"5\" -DREGINA_VERSION_SUPP=\"\" -DREGINA_BITS=64 -DHAVE_CONFIG_H -DHAVE_GCI -I./gci   -I. -I. -I./contrib    -o error.o -c ./error.c
./error.c: In function ‘get_message_indexes’:
./error.c:994:27: warning: ‘Unsupported native language .’ directive writing 29 bytes into a region of size 4 [-Wformat-overflow=]
  994 |          Str_len( err ) = sprintf( err->value, "Unsupported native language \"%.*s\"",
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  995 |                                                len, ptr );
      |                                                ~~~~~~~~~~
./error.c:994:27: note: assuming directive output of 1 byte
In file included from /usr/include/stdio.h:970,
                 from ./rexx.h:222,
                 from ./error.c:20:
In function ‘sprintf’,
    inlined from ‘get_message_indexes’ at ./error.c:994:27:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:30:10: note: ‘__builtin___sprintf_chk’ output between 31 and 2147483678 bytes into a destination of size 4
   30 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   31 |                                   __glibc_objsize (__s), __fmt,
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   32 |                                   __va_arg_pack ());
      |                                   ~~~~~~~~~~~~~~~~~
./error.c: In function ‘__regina_exiterror’:
./error.c:811:30: warning: ‘%d’ directive writing between 1 and 11 bytes into a region of size 4 [-Wformat-overflow=]
  811 |          et->errornum->len = sprintf( et->errornum->value, "%d", -errorno );
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./error.c:811:30: note: directive argument in the range [-2147483647, 2147483647]
In function ‘sprintf’,
    inlined from ‘__regina_exiterror’ at ./error.c:811:30:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:30:10: note: ‘__builtin___sprintf_chk’ output between 2 and 12 bytes into a destination of size 4
   30 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   31 |                                   __glibc_objsize (__s), __fmt,
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   32 |                                   __va_arg_pack ());
      |                                   ~~~~~~~~~~~~~~~~~
x86_64-linux-gnu-gcc -DNDEBUG -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/regina-rexx-3.9.5+dfsg1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -DREGINA_SHARE_DIRECTORY=\"/usr/share/regina-rexx\" -funsigned-char -DREGINA_VERSION_DATE=\""25 Jun 2022"\" -DREGINA_VERSION_MAJOR=\"3\" -DREGINA_VERSION_MINOR=\"9\" -DREGINA_VERSION_RELEASE=\"5\" -DREGINA_VERSION_SUPP=\"\" -DREGINA_BITS=64 -DHAVE_CONFIG_H -DHAVE_GCI -I./gci   -I. -I. -I./contrib    -o variable.o -c ./variable.c
./variable.c: In function ‘assign_foliage’:
./variable.c:1497:12: error: expected identifier or ‘(’ before ‘nullptr’
 1497 |    streng *nullptr = NULL; /* allow REPLACE_VALUE macro to pass NULL value under C++ */
      |            ^~~~~~~
make[1]: *** [Makefile:423: variable.o] Error 1
make[1]: Leaving directory '/build/reproducible-path/regina-rexx-3.9.5+dfsg1'
make: *** [debian/rules:59: build-stamp] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2

#1097785#10
Date:
2025-02-20 09:43:09 UTC
From:
To:
...

Checked by passing -std=gnu23 to compiler.

nullptr has become a reserved word in C23. Renaming internal nullptr to
something else should fix this. In attached patch I tried mynullptr, in this
file and others.

However, this is not all, then comes next problem,

./gci/gci_call.c: In function 'doCall':
./gci/gci_call.c:75:8: error: too many arguments to function '(void (*)(void))func'
   75 |       ((void (*)())func)( GCI_PASSARGS( buf ) );
      |       ~^~~~~~~~~~~~~~~~~
./gci/gci_call.c:63:33: error: too many arguments to function '(signed char (*)(void))func'
   63 |                                ((type (*)())func)( GCI_PASSARGS( buf ) ); \
      |                                ~^~~~~~~~~~~~~~~~~
...

#1097785#17
Date:
2025-02-21 19:13:13 UTC
From:
To:
One more problem I found after disabling gci to mask previous error message
---- x86_64-linux-gnu-gcc -c -DNDEBUG -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/regina-rexx-3.9.5+dfsg1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -std=gnu23 -Wdate-time -D_FORTIFY_SOURCE=2 -DREGINA_SHARE_DIRECTORY=\"/usr/share/regina-rexx\" -funsigned-char -DREGINA_VERSION_DATE=\""25 Jun 2022"\" -DREGINA_VERSION_MAJOR=\"3\" -DREGINA_VERSION_MINOR=\"9\" -DREGINA_VERSION_RELEASE=\"5\" -DREGINA_VERSION_SUPP=\"\" -DREGINA_BITS=64 -DHAVE_CONFIG_H -I. -I. -I./contrib -o regfilesys.o -fPIC -DDYNAMIC ./regutil/regfilesys.c In file included from ./regutil/regfilesys.c:29: ./regutil/regutil.h:28:4: error: expected identifier before 'false' 28 | false, | ^~~~~ ./regutil/regfilesys.c: In function 'sysfiletree': ./regutil/regfilesys.c:994:12: warning: ignoring return value of 'getcwd' declared with attribute 'warn_unused_result' [-Wunused-result] 994 | getcwd(cp1, MAXPATHLEN+1); | ^~~~~~~~~~~~~~~~~~~~~~~~~ make[1]: *** [Makefile:939: regfilesys.o] Error 1 ---- Seems that there were some changes with booleans. I have been playing with attached diff and minimally tested the results. The problem that remains is the one I mentioned before. When gci is enabled, some errors of this kind are shown
---- ./gci/gci_call.c: In function 'doCall': ./gci/gci_call.c:75:8: error: too many arguments to function 'func' 75 | ((void (*)())func)( GCI_PASSARGS( buf ) ); | ~^~~~~~~~~~~~~~~~~ ./gci/gci_call.c:63:33: error: too many arguments to function '(signed char (*)(void))func' 63 | ((type (*)())func)( GCI_PASSARGS( buf ) ); \ | ~^~~~~~~~~~~~~~~~~ ----
--- Agustin
#1097785#22
Date:
2025-02-24 00:46:13 UTC
From:
To:
Control: tags -1 + patch

Hi,

Looks like I got what happens. Seems that there were two changes in
C23 regarding variable arguments list in function definitions. On
the one hand, '()' seems to mean now void and only void, and no
longer a non specified variable argument list. On the other hand,
plain C++ ellipsis is now accepted for that purpose, without a
first explicit argument type.

Attached patch tries to use ellipsis when possible, be it C++ or
C (>=C23).

#1097785#35
Date:
2025-09-06 08:47:20 UTC
From:
To:
El lun, 24 feb 2025 a las 1:51, Agustin Martin (<agmartin@debian.org>) escribió:
....

Hi, Alen,

This bug report has become RC and package is marked for autoremoval
from testing, so I am considering a NMU for this, unless you oppose.

This upload should contain patches  in this thread (sent and already
applied upstream) and at the same time a fix for

#1106995 [regina-rexx: add libcrypt-dev to Build-Depends]

I will start preparing that NMU, let me know if you prefer to handle
this yourself.

Regards,

#1097785#40
Date:
2025-09-07 08:54:53 UTC
From:
To:
Hi Agustin,

Thank you for your help. Please go ahead.

Regards,