#1098041 units: ftbfs with GCC-15

Package:
src:units
Source:
src:units
Submitter:
Matthias Klose
Date:
2025-09-04 22:11:24 UTC
Severity:
normal
Tags:
#1098041#5
Date:
2025-02-17 17:58:34 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/units_2.24-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

[...]
      |                ^~~~~
parse.tab.c:70:25: note: declared here
   70 | #define yylex           unitslex
      |                         ^~~~~~~~
parse.y:48:5: note: in expansion of macro ‘yylex’
   48 | int yylex();
      |     ^~~~~
parse.y: At top level:
parse.tab.c:70:25: error: conflicting types for ‘unitslex’; have ‘int(UNITSSTYPE *, struct commtype *)’
   70 | #define yylex           unitslex
      |                         ^~~~~~~~
parse.y:342:5: note: in expansion of macro ‘yylex’
  342 | int yylex(YYSTYPE *lvalp, struct commtype *comm)
      |     ^~~~~
parse.tab.c:70:25: note: previous declaration of ‘unitslex’ with type ‘int(void)’
   70 | #define yylex           unitslex
      |                         ^~~~~~~~
parse.y:48:5: note: in expansion of macro ‘yylex’
   48 | int yylex();
      |     ^~~~~
parse.y: In function ‘unitslex’:
parse.y:399:7: error: too many arguments to function ‘strchr’; expected 0, have 2
  399 |   if (strchr(number_start,*inptr)){  /* prevent "nan" from being recognized */
      |       ^~~~~~ ~~~~~~~~~~~~
units.h:57:12: note: declared here
   57 |      char *strchr();
      |            ^~~~~~
parse.y:405:22: error: too many arguments to function ‘strchr’; expected 0, have 2
  405 |       if (*endloc && strchr(number_start,*endloc))
      |                      ^~~~~~ ~~~~~~~~~~~~
units.h:57:12: note: declared here
   57 |      char *strchr();
      |            ^~~~~~
parse.y:430:34: error: too many arguments to function ‘strchr’; expected 0, have 2
  430 |       (length==1 || length==2 && strchr("23456789",inptr[1]))){
      |                                  ^~~~~~ ~~~~~~~~~~
units.h:57:12: note: declared here
   57 |      char *strchr();
      |            ^~~~~~
parse.y:447:7: error: too many arguments to function ‘strchr’; expected 0, have 2
  447 |   if (strchr(nonunitstart,*inptr)){
      |       ^~~~~~ ~~~~~~~~~~~~
units.h:57:12: note: declared here
   57 |      char *strchr();
      |            ^~~~~~
parse.y:451:7: error: too many arguments to function ‘strchr’; expected 0, have 2
  451 |   if (strchr(nonunitend, inptr[length-1])){
      |       ^~~~~~ ~~~~~~~~~~
units.h:57:12: note: declared here
   57 |      char *strchr();
      |            ^~~~~~
parse.y:518:7: error: too many arguments to function ‘strchr’; expected 0, have 2
  518 |   if (strchr("23456789",inptr[length-1]) && !hassubscript(name)) {
      |       ^~~~~~ ~~~~~~~~~~
units.h:57:12: note: declared here
   57 |      char *strchr();
      |            ^~~~~~
parse.y:522:9: error: too many arguments to function ‘strchr’; expected 0, have 2
  522 |     if (strchr(number_start, name[length-1])){
      |         ^~~~~~ ~~~~~~~~~~~~
units.h:57:12: note: declared here
   57 |      char *strchr();
      |            ^~~~~~
make[1]: *** [Makefile:82: parse.tab.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:82: units.o] Error 1
make[1]: Leaving directory '/build/reproducible-path/units-2.24'
dh_auto_build: error: make -j8 returned exit code 2
make: *** [debian/rules:7: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2