#1096647 fortune-mod: ftbfs with GCC-15

#1096647#5
Date:
2025-02-17 17:13:52 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/fortune-mod_1.99.1-9_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

[...]
/usr/include/recode.h:82:44: note: expected ‘const char *’ but argument is of type ‘unsigned char *’
   82 | char *recode_string (RECODE_CONST_REQUEST, const char *);
      |                                            ^~~~~~~~~~~~
fortune.c:1556:28: warning: pointer targets in assignment from ‘unsigned char *’ to ‘char *’ differ in signedness [-Wpointer-sign]
 1556 |                     output = Fortbuf;
      |                            ^
fortune.c:1562:28: warning: pointer targets in assignment from ‘char *’ to ‘unsigned char *’ differ in signedness [-Wpointer-sign]
 1562 |                     for (p = output; (ch = *p); ++p)
      |                            ^
fortune.c: In function ‘display’:
fortune.c:1621:30: warning: pointer targets in passing argument 1 of ‘fgets’ differ in signedness [-Wpointer-sign]
 1621 |     for (Fort_len = 0; fgets(line, sizeof line, fp->inf) != NULL &&
      |                              ^~~~
      |                              |
      |                              unsigned char *
/usr/include/x86_64-linux-gnu/bits/stdio2.h:305:8: note: expected ‘char *’ but argument is of type ‘unsigned char *’
  305 | fgets (__fortify_clang_overload_arg (char *, __restrict, __s), int __n,
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
fortune.c:1626:20: warning: pointer targets in assignment from ‘unsigned char *’ to ‘char *’ differ in signedness [-Wpointer-sign]
 1626 |             for (p = line; (ch = *p); ++p)
      |                    ^
fortune.c:1636:46: warning: pointer targets in passing argument 2 of ‘recode_string’ differ in signedness [-Wpointer-sign]
 1636 |             output = recode_string (request, line);
      |                                              ^~~~
      |                                              |
      |                                              unsigned char *
/usr/include/recode.h:82:44: note: expected ‘const char *’ but argument is of type ‘unsigned char *’
   82 | char *recode_string (RECODE_CONST_REQUEST, const char *);
      |                                            ^~~~~~~~~~~~
fortune.c:1641:19: warning: pointer targets in passing argument 1 of ‘fputs’ differ in signedness [-Wpointer-sign]
 1641 |             fputs(line, stdout);
      |                   ^~~~
      |                   |
      |                   unsigned char *
In file included from fortune.c:136:
/usr/include/stdio.h:707:42: note: expected ‘const char * restrict’ but argument is of type ‘unsigned char *’
  707 | extern int fputs (const char *__restrict __s, FILE *__restrict __stream)
      |                   ~~~~~~~~~~~~~~~~~~~~~~~^~~
fortune.c: In function ‘fortlen’:
fortune.c:1666:22: warning: pointer targets in passing argument 1 of ‘fgets’ differ in signedness [-Wpointer-sign]
 1666 |         while (fgets(line, sizeof line, Fortfile->inf) != NULL &&
      |                      ^~~~
      |                      |
      |                      unsigned char *
/usr/include/x86_64-linux-gnu/bits/stdio2.h:305:8: note: expected ‘char *’ but argument is of type ‘unsigned char *’
  305 | fgets (__fortify_clang_overload_arg (char *, __restrict, __s), int __n,
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
fortune.c:1668:29: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Wpointer-sign]
 1668 |             nchar += strlen(line);
      |                             ^~~~
      |                             |
      |                             unsigned char *
/usr/include/string.h:407:35: note: expected ‘const char *’ but argument is of type ‘unsigned char *’
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
make[4]: *** [<builtin>: fortune.o] Error 1
make[4]: Leaving directory '/build/reproducible-path/fortune-mod-1.99.1/fortune'
make[3]: *** [Makefile:110: fortune-bin] Error 2
make[3]: *** Waiting for unfinished jobs....
gcc -Wl,-z,relro -o unstr unstr.o
gcc -Wl,-z,relro -o strfile strfile.o
make[4]: Leaving directory '/build/reproducible-path/fortune-mod-1.99.1/util'
make[3]: Leaving directory '/build/reproducible-path/fortune-mod-1.99.1'
dh_auto_build: error: make -j8 "INSTALL=install --strip-program=true" fortune-bin util-bin returned exit code 2
make[2]: *** [debian/rules:8: override_dh_auto_build-arch] Error 25
make[2]: Leaving directory '/build/reproducible-path/fortune-mod-1.99.1'
make[1]: *** [debian/rules:4: build] Error 2
make[1]: Leaving directory '/build/reproducible-path/fortune-mod-1.99.1'
make: *** [debian/rules:4: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2

#1096647#14
Date:
2025-09-05 15:43:27 UTC
From:
To:
I have pushed the fix to the git repo.