Subject: ngetty: ftbfs with GCC-15

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

Package: src:ngetty
Version: 1.1-13
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/ngetty_1.1-13_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

[...]
CC = gcc
CFLAGS = -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/ngetty-1.1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Os
LDFLAGS = -Wl,-z,relro -s
gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/ngetty-1.1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Os -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -s -DNGETTY_SELFPIPE -o ngetty ngetty.c
rm -f boottime_defs.hZ; cat boottime_defs.h
rm -f vhangup_defs.hZ; cat vhangup_defs.h
ngetty.c: In function ‘opentty’:
ngetty.c:137:3: warning: ignoring return value of ‘chown’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  137 |   chown(path, 0, 0);
      |   ^~~~~~~~~~~~~~~~~
ngetty.c: In function ‘main’:
ngetty.c:274:3: warning: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  274 |   read(0, pi, sizeof pi);
      |   ^~~~~~~~~~~~~~~~~~~~~~
ngetty.c: In function ‘sig_handler’:
ngetty.c:175:3: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  175 |   write(1,"",1);
      |   ^~~~~~~~~~~~~
#define HAVE_SYSTEM_VHANGUP
ngetty.c: In function ‘opentty’:
ngetty.c:137:3: warning: ignoring return value of ‘chown’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  137 |   chown(path, 0, 0);
      |   ^~~~~~~~~~~~~~~~~
ngetty.c: In function ‘main’:
ngetty.c:274:3: warning: ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  274 |   read(0, pi, sizeof pi);
      |   ^~~~~~~~~~~~~~~~~~~~~~
ngetty.c: In function ‘sig_handler’:
ngetty.c:175:3: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  175 |   write(1,"",1);
      |   ^~~~~~~~~~~~~
ngetty.c: In function ‘opentty’:
ngetty.c:137:3: warning: ignoring return value of ‘chown’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  137 |   chown(path, 0, 0);
      |   ^~~~~~~~~~~~~~~~~
rm -f sysinfo_defs.hZ; cat sysinfo_defs.h
#define HAVE_SYSTEM_SYSINFO
gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/ngetty-1.1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Os -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -s -c str_add.c
gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/ngetty-1.1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Os -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -s -c str_copy.c
gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/ngetty-1.1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Os -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -s -c str_copynz.c
gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/ngetty-1.1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Os -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -s -c str_diffn.c
gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/ngetty-1.1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Os -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -s -c str_len.c
gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/ngetty-1.1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Os -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -s -c splitmem.c
gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/ngetty-1.1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Os -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -s -c out_put.c
gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/ngetty-1.1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Os -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -s -c x_atoi.c
gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/ngetty-1.1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Os -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -s -c fmt_nmb_.c
gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/ngetty-1.1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Os -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -s -c fmt_str_.c
gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/ngetty-1.1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Os -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -s -c fmt_ulong.c
gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/ngetty-1.1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Os -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -s -c fmt_utmp_ip.c
gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/ngetty-1.1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Os -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -s -c fmt_xlong.c
gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/ngetty-1.1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Os -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -s -c const_io.c
gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/ngetty-1.1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Os -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -s -c utmp_io.c
gcc -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/reproducible-path/ngetty-1.1=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wall -Os -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -s -c utmp_do.c
const_io.c: In function ‘const_io’:
const_io.c:7:15: error: too many arguments to function ‘op’; expected 0, have 3
    7 |     int ret = op(fd, x, len);
      |               ^~ ~~
make[1]: *** [Makefile:53: const_io.o] Error 1
make[1]: *** Waiting for unfinished jobs....
utmp_do.c: In function ‘utmp_do’:
utmp_do.c:94:5: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   94 |     write(fd, &u, UTMP_SIZE);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~
strip -R .comment -R .note ngetty.tiny
strip -R .comment -R .note ngetty.sortpfd
strip -R .comment -R .note ngetty
make[1]: Leaving directory '/build/reproducible-path/ngetty-1.1'
dh_auto_build: error: make -j8 "INSTALL=install --strip-program=true" returned exit code 2
make: *** [debian/rules:7: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2