#1096739 gnucobol4: ftbfs with GCC-15

#1096739#5
Date:
2025-02-17 17:16:47 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/gnucobol4_4.0~early~20200606-7_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

[...]
                 from fileio.h:121,
                 from fextfh.c:22:
../libcob/common.h:1478:33: note: 'file_status' declared here
 1478 |         unsigned char           file_status[4];         /* FILE STATUS */
      |                                 ^~~~~~~~~~~
fextfh.c: In function 'update_fcd_to_file':
fextfh.c:276:21: warning: the comparison will always evaluate as 'true' for the address of 'file_status' will never be NULL [-Waddress]
  276 |                 if (f->file_status) {
      |                     ^
../libcob/common.h:1478:33: note: 'file_status' declared here
 1478 |         unsigned char           file_status[4];         /* FILE STATUS */
      |                                 ^~~~~~~~~~~
fextfh.c: In function 'cob_extfh_open':
fextfh.c:602:13: warning: the comparison will always evaluate as 'true' for the address of 'file_status' will never be NULL [-Waddress]
  602 |         if (f->file_status) {
      |             ^
../libcob/common.h:1478:33: note: 'file_status' declared here
 1478 |         unsigned char           file_status[4];         /* FILE STATUS */
      |                                 ^~~~~~~~~~~
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I..  -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -finline-functions -D_FORTIFY_SOURCE=2 -pipe -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k -c -o focextfh.lo focextfh.c
common.c: In function 'cob_exit_common_modules':
common.c:589:37: error: assignment to 'int (*)(const int)' from incompatible pointer type 'int (*)(void)' [-Wincompatible-pointer-types]
  589 |                         cancel_func = mod->module_cancel.funcint;
      |                                     ^
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..  -I..  -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -finline-functions -D_FORTIFY_SOURCE=2 -pipe -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k -c -o flmdb.lo flmdb.c
fileio.c: In function 'indexed_file_type':
fileio.c:350:17: warning: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Wunused-result]
  350 |                 fread(hbuf, 1, sizeof(hbuf), fdin);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fileio.c:368:9: warning: ignoring return value of 'fread' declared with attribute 'warn_unused_result' [-Wunused-result]
  368 |         fread(hbuf, 1, sizeof(hbuf), fdin);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -finline-functions -D_FORTIFY_SOURCE=2 -pipe -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k -c focextfh.c  -fPIC -DPIC -o .libs/focextfh.o
common.c: In function 'print_version':
common.c:7303:26: warning: macro '__DATE__' might prevent reproducible builds [-Wdate-time]
 7303 |         status = sscanf (__DATE__, "%s %d %d", month, &day, &year);
      |                          ^~~~~~~~
common.c:7306:66: warning: macro '__TIME__' might prevent reproducible builds [-Wdate-time]
 7306 |                           "%s %2.2d %4.4d %s", month, day, year, __TIME__);
      |                                                                  ^~~~~~~~
common.c:7309:36: warning: macro '__DATE__' might prevent reproducible builds [-Wdate-time]
 7309 |                           "%s %s", __DATE__, __TIME__);
      |                                    ^~~~~~~~
common.c:7309:46: warning: macro '__TIME__' might prevent reproducible builds [-Wdate-time]
 7309 |                           "%s %s", __DATE__, __TIME__);
      |                                              ^~~~~~~~
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -finline-functions -D_FORTIFY_SOURCE=2 -pipe -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k -c flmdb.c  -fPIC -DPIC -o .libs/flmdb.o
common.c: In function 'cob_dump_module':
common.c:8258:45: error: assignment to 'int (*)(const int)' from incompatible pointer type 'int (*)(void)' [-Wincompatible-pointer-types]
 8258 |                                 cancel_func = mod->module_cancel.funcint;
      |                                             ^
make[4]: *** [Makefile:646: common.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -finline-functions -D_FORTIFY_SOURCE=2 -pipe -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k -c focextfh.c -o focextfh.o >/dev/null 2>&1
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -finline-functions -D_FORTIFY_SOURCE=2 -pipe -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k -c flmdb.c -o flmdb.o >/dev/null 2>&1
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -finline-functions -D_FORTIFY_SOURCE=2 -pipe -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k -c strings.c -o strings.o >/dev/null 2>&1
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -finline-functions -D_FORTIFY_SOURCE=2 -pipe -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k -c fextfh.c -o fextfh.o >/dev/null 2>&1
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -finline-functions -D_FORTIFY_SOURCE=2 -pipe -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k -c numeric.c -o numeric.o >/dev/null 2>&1
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -finline-functions -D_FORTIFY_SOURCE=2 -pipe -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k -c move.c -o move.o >/dev/null 2>&1
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I.. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -finline-functions -D_FORTIFY_SOURCE=2 -pipe -fsigned-char -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k -c fileio.c -o fileio.o >/dev/null 2>&1
make[4]: Leaving directory '/build/reproducible-path/gnucobol4-4.0~early~20200606/libcob'
make[3]: *** [Makefile:624: all-recursive] Error 1
make[3]: Leaving directory '/build/reproducible-path/gnucobol4-4.0~early~20200606'
make[2]: *** [Makefile:533: all] Error 2
make[2]: Leaving directory '/build/reproducible-path/gnucobol4-4.0~early~20200606'
dh_auto_build: error: make -j8 returned exit code 2
make[1]: *** [debian/rules:32: override_dh_auto_build] Error 25
make[1]: Leaving directory '/build/reproducible-path/gnucobol4-4.0~early~20200606'
make: *** [debian/rules:16: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2