#1097464 ngrep: ftbfs with GCC-15

Package:
src:ngrep
Source:
src:ngrep
Submitter:
Matthias Klose
Date:
2025-09-04 22:09:33 UTC
Severity:
normal
Tags:
#1097464#5
Date:
2025-02-17 17:39:53 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/ngrep_1.47+ds1-6_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

[...]
  130 | void dump_delay_proc_init(struct pcap_pkthdr *);
      |      ^~~~~~~~~~~~~~~~~~~~
ngrep.c: In function ‘main’:
ngrep.c:300:32: warning: comparison of distinct pointer types lacks a cast [-Wcompare-distinct-pointer-types]
  300 |                 if (print_time == &print_time_diff) {
      |                                ^~
ngrep.c:301:32: error: assignment to ‘void (*)(void)’ from incompatible pointer type ‘void (*)(struct pcap_pkthdr *)’ [-Wincompatible-pointer-types]
  301 |                     print_time = print_time_offset;
      |                                ^
ngrep.h:139:6: note: ‘print_time_offset’ declared here
  139 | void print_time_offset  (struct pcap_pkthdr *);
      |      ^~~~~~~~~~~~~~~~~
ngrep.c:304:32: error: assignment to ‘void (*)(void)’ from incompatible pointer type ‘void (*)(struct pcap_pkthdr *)’ [-Wincompatible-pointer-types]
  304 |                     print_time = &print_time_diff;
      |                                ^
ngrep.h:138:6: note: ‘print_time_diff’ declared here
  138 | void print_time_diff    (struct pcap_pkthdr *);
      |      ^~~~~~~~~~~~~~~
ngrep.c:314:28: error: assignment to ‘void (*)(void)’ from incompatible pointer type ‘void (*)(struct pcap_pkthdr *)’ [-Wincompatible-pointer-types]
  314 |                 print_time = &print_time_absolute;
      |                            ^
ngrep.h:137:6: note: ‘print_time_absolute’ declared here
  137 | void print_time_absolute(struct pcap_pkthdr *);
      |      ^~~~~~~~~~~~~~~~~~~
ngrep.c: In function ‘setup_pcap_source’:
ngrep.c:461:13: warning: ‘pcap_lookupdev’ is deprecated: use 'pcap_findalldevs' and use the first device [-Wdeprecated-declarations]
  461 |             pcap_lookupdev(pc_err);
      |             ^~~~~~~~~~~~~~
In file included from ngrep.c:83:
/usr/include/pcap/pcap.h:444:18: note: declared here
  444 | PCAP_API char   *pcap_lookupdev(char *);
      |                  ^~~~~~~~~~~~~~
ngrep.c: In function ‘setup_matcher’:
ngrep.c:642:20: error: assignment to ‘int8_t (*)(void)’ {aka ‘signed char (*)(void)’} from incompatible pointer type ‘int8_t (*)(unsigned char *, uint32_t,  uint16_t *, uint16_t *)’ {aka ‘signed char (*)(unsigned char *, unsigned int,  short unsigned int *, short unsigned int *)’} [-Wincompatible-pointer-types]
  642 |         match_func = &bin_match_func;
      |                    ^
ngrep.h:134:8: note: ‘bin_match_func’ declared here
  134 | int8_t bin_match_func  (unsigned char *, uint32_t, uint16_t *, uint16_t *);
      |        ^~~~~~~~~~~~~~
ngrep.c:732:20: error: assignment to ‘int8_t (*)(void)’ {aka ‘signed char (*)(void)’} from incompatible pointer type ‘int8_t (*)(unsigned char *, uint32_t,  uint16_t *, uint16_t *)’ {aka ‘signed char (*)(unsigned char *, unsigned int,  short unsigned int *, short unsigned int *)’} [-Wincompatible-pointer-types]
  732 |         match_func = &re_match_func;
      |                    ^
ngrep.h:133:8: note: ‘re_match_func’ declared here
  133 | int8_t re_match_func   (unsigned char *, uint32_t, uint16_t *, uint16_t *);
      |        ^~~~~~~~~~~~~
ngrep.c: In function ‘dump_packet’:
ngrep.c:949:21: error: too many arguments to function ‘match_func’; expected 0, have 4
  949 |     if ((len > 0 && match_func(data, len, &match_index, &match_size) == invert_match) && !keep_matching)
      |                     ^~~~~~~~~~ ~~~~
ngrep.c:953:9: error: too many arguments to function ‘dump_delay’; expected 0, have 1
  953 |         dump_delay(h);
      |         ^~~~~~~~~~ ~
ngrep.c:976:9: error: too many arguments to function ‘print_time’; expected 0, have 1
  976 |         print_time(h);
      |         ^~~~~~~~~~ ~
ngrep.c: In function ‘dump_delay_proc_init’:
ngrep.c:1329:16: error: assignment to ‘void (*)(void)’ from incompatible pointer type ‘void (*)(struct pcap_pkthdr *)’ [-Wincompatible-pointer-types]
 1329 |     dump_delay = &dump_delay_proc;
      |                ^
ngrep.h:131:6: note: ‘dump_delay_proc’ declared here
  131 | void dump_delay_proc     (struct pcap_pkthdr *);
      |      ^~~~~~~~~~~~~~~
ngrep.c:1334:5: error: too many arguments to function ‘dump_delay’; expected 0, have 1
 1334 |     dump_delay(h);
      |     ^~~~~~~~~~ ~
make[1]: *** [Makefile:51: ngrep.o] Error 1
make[1]: Leaving directory '/build/reproducible-path/ngrep-1.47+ds1'
dh_auto_build: error: make -j8 returned exit code 2
make: *** [debian/rules:6: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2