Subject: evince: ftbfs with GCC-15

From: Matthias Klose <[email-masked]>
Date: Mon, 17 Feb 2025 17:12:16 +0000

Package: src:evince
Version: 46.3.1-1
Severity: important
Tags: sid forky
User: [email-masked]
Usertags: ftbfs-gcc-15

[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/evince_46.3.1-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

[...]
FAILED: backend/dvi/mdvi-lib/libmdvi.a.p/dviread.c.o 
In file included from /usr/include/kpathsea/debug.h:26,
                 from ../backend/dvi/mdvi-lib/private.h:35,
                 from ../backend/dvi/mdvi-lib/dviread.c:30:
/usr/include/kpathsea/c-std.h:48:14: error: conflicting types for ‘getenv’; have ‘char *(void)’
   48 | extern char *getenv ();
      |              ^~~~~~
In file included from ../backend/dvi/mdvi-lib/dviread.c:21:
/usr/include/stdlib.h:773:14: note: previous declaration of ‘getenv’ with type ‘char *(const char *)’
  773 | extern char *getenv (const char *__name) __THROW __nonnull ((1)) __wur;
      |              ^~~~~~
In file included from /usr/include/kpathsea/c-std.h:76:
/usr/include/kpathsea/c-memstr.h:57:14: error: conflicting types for ‘strtok’; have ‘char *(void)’
   57 | extern char *strtok ();
      |              ^~~~~~
In file included from ../backend/dvi/mdvi-lib/dviread.c:23:
/usr/include/string.h:356:14: note: previous declaration of ‘strtok’ with type ‘char *(char * restrict,  const char * restrict)’
  356 | extern char *strtok (char *__restrict __s, const char *__restrict __delim)
      |              ^~~~~~
/usr/include/kpathsea/c-memstr.h:59:14: error: conflicting types for ‘strstr’; have ‘char *(void)’
   59 | extern char *strstr ();
      |              ^~~~~~
/usr/include/string.h:350:14: note: previous declaration of ‘strstr’ with type ‘char *(const char *, const char *)’
  350 | extern char *strstr (const char *__haystack, const char *__needle)
      |              ^~~~~~
../backend/dvi/mdvi-lib/dviread.c: In function ‘mdvi_init_context’:
../backend/dvi/mdvi-lib/dviread.c:767:9: warning: ignoring return value of ‘fread’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  767 |         fread(dvi->fileid, 1, n, p);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../libview/ev-view.c: In function ‘ev_view_move_cursor’:
../libview/ev-view.c:7203:22: warning: ‘select_start_offset’ may be used uninitialized [-Wmaybe-uninitialized]
 7203 |                 if (!get_caret_cursor_area (view, select_start_page, select_start_offset, &select_start_rect))
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../libview/ev-view.c:7034:25: note: ‘select_start_offset’ was declared here
 7034 |         gint            select_start_offset;
      |                         ^~~~~~~~~~~~~~~~~~~
../libview/ev-view.c:7203:22: warning: ‘select_start_page’ may be used uninitialized [-Wmaybe-uninitialized]
 7203 |                 if (!get_caret_cursor_area (view, select_start_page, select_start_offset, &select_start_rect))
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../libview/ev-view.c:7035:25: note: ‘select_start_page’ was declared here
 7035 |         gint            select_start_page;
      |                         ^~~~~~~~~~~~~~~~~
ninja: build stopped: subcommand failed.
dh_auto_build: error: cd obj-x86_64-linux-gnu && LC_ALL=C.UTF-8 ninja -j8 -v returned exit code 1
make: *** [debian/rules:9: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2