#1097808 rstatd: ftbfs with GCC-15

Package:
src:rstatd
Source:
src:rstatd
Submitter:
Matthias Klose
Date:
2026-05-23 07:09:01 UTC
Severity:
normal
Tags:
#1097808#5
Date:
2025-02-17 17:51:04 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/rstatd_4.0.1-12_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

[...]
checking for stdint.h... yes
checking for unistd.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether gcc needs -traditional... no
checking for ANSI C header files... (cached) no
checking return type of signal handlers... int
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config.h
config.status: executing depfiles commands
touch configure-stamp
dh_testdir
/usr/bin/make
make[1]: Entering directory '/build/reproducible-path/rstatd-4.0.1'
rm -f rstat.h
rpcgen -h -o rstat.h rstat.x
/usr/bin/make  all-am
make[2]: Entering directory '/build/reproducible-path/rstatd-4.0.1'
gcc -DHAVE_CONFIG_H -I. -I. -I.   -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/rstatd-4.0.1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -I/usr/include/tirpc -c rup.c
rup.c:42:6: error: conflicting types for ‘bzero’; have ‘void(void)’
   42 | void bzero();
      |      ^~~~~
In file included from /usr/include/features.h:510,
                 from /usr/include/unistd.h:25,
                 from rup.c:28:
/usr/include/x86_64-linux-gnu/bits/strings_fortified.h:30:1: note: previous definition of ‘bzero’ with type ‘void(void *, long unsigned int)’
   30 | __NTH (bzero (void *__dest, size_t __len))
      | ^~~~~
rup.c:43:6: error: conflicting types for ‘bcopy’; have ‘void(void)’
   43 | void bcopy();
      |      ^~~~~
/usr/include/x86_64-linux-gnu/bits/strings_fortified.h:23:1: note: previous definition of ‘bcopy’ with type ‘void(const void *, void *, long unsigned int)’
   23 | __NTH (bcopy (const void *__src, void *__dest, size_t __len))
      | ^~~~~
rup.c:44:7: error: conflicting types for ‘rindex’; have ‘char *(void)’
   44 | char *rindex();
      |       ^~~~~~
In file included from /usr/include/string.h:462,
                 from /usr/include/x86_64-linux-gnu/sys/un.h:38,
                 from /usr/include/tirpc/rpc/clnt.h:46,
                 from /usr/include/tirpc/rpc/rpc.h:49,
                 from rup.c:30:
/usr/include/strings.h:96:14: note: previous declaration of ‘rindex’ with type ‘char *(const char *, int)’
   96 | extern char *rindex (const char *__s, int __c)
      |              ^~~~~~
rup.c: In function ‘main’:
rup.c:324:29: error: too many arguments to function ‘rindex’; expected 0, have 2
  324 |         if(!(program_name = rindex(argv[0],'/')))
      |                             ^~~~~~ ~~~~~~~
rup.c:44:7: note: declared here
   44 | char *rindex();
      |       ^~~~~~
rup.c:354:17: error: too many arguments to function ‘bcopy’; expected 0, have 3
  354 |                 bcopy(hp->h_addr,(caddr_t)&server_addr.sin_addr, hp->h_length);
      |                 ^~~~~     ~~~~~~
rup.c:43:6: note: declared here
   43 | void bcopy();
      |      ^~~~~
make[2]: *** [Makefile:330: rup.o] Error 1
make[2]: Leaving directory '/build/reproducible-path/rstatd-4.0.1'
make[1]: *** [Makefile:196: all] Error 2
make[1]: Leaving directory '/build/reproducible-path/rstatd-4.0.1'
make: *** [debian/rules:23: build-stamp] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2

#1097808#14
Date:
2026-05-23 07:08:07 UTC
From:
To:
Attached debdiff for an NMU (rstatd 4.0.1-12.1) fixing the GCC 15 FTBFS.

Under C23, an empty parameter list '()' means '(void)'. Several K&R-
style declarations in this package therefore declared zero-argument
functions, conflicting with their real prototypes. Four patches:
    * 06-fix-ftbfs-gcc15-rup.patch — rup.c: drop K&R 'void bzero();
void bcopy(); char *rindex();' and include <strings.h>.
   * 07-fix-ftbfs-gcc15-rsysinfo.patch — same fix in rsysinfo.c.
   * 08-fix-ftbfs-gcc15-rstat_main.patch — rstat_main.c: drop the
redundant K&R declaration of rstat_service (rstat_proc.h has the
correct prototype), update test_connect declaration, and change
cleanup() to take 'int sig' for signal()-handler compatibility.
   * 09-fix-ftbfs-gcc15-rstat_proc.patch — rstat_proc.c: update
test_connect() definition to take 'int sig' to match.
Note: the bug report quotes only the rup.c errors, but the build also
fails in rstat_main.c and rstat_proc.c once those are fixed (make
stops at the first failure). The submitted NMU addresses all of them.
Built cleanly in a sid amd64 sbuild chroot. The only lintian error
('alien-tag source-contains-CVS-dir' in
debian/source/lintian-overrides) is pre-existing and unrelated to this
NMU.