-
Notifications
You must be signed in to change notification settings - Fork 894
Open
Labels
Description
It looks like some constants need to be either #ifdef
-wrapped properly or made mandatory in Autoconf/CMake. AFAIR, on AIX 7.1 at least 4 build matrix setups managed to pass, on AIX 7.2 the source compiled, but failed to link. On AIX 7.3 it fails to compile (as can be reproduced on CFarm host gcc119):
bash-5.1$ PATH="/opt/freeware/bin:$PATH" MAKEFLAGS='-j4' MATRIX_CC='gcc' MATRIX_REMOTE=no TEST_RELEASETAR=no ./build_matrix.sh
[...]
./pcap-bpf.c: In function 'bpf_bind':
./pcap-bpf.c:756:21: error: 'BIOCSETIF' undeclared (first use in this function); did you mean 'TIOCSETC'?
756 | status = ioctl(fd, BIOCSETIF, (caddr_t)&ifr);
| ^~~~~~~~~
| TIOCSETC
./pcap-bpf.c:756:21: note: each undeclared identifier is reported only once for each function it appears in
./pcap-bpf.c: In function 'pcap_stats_bpf':
./pcap-bpf.c:1146:18: error: storage size of 's' isn't known
1146 | struct bpf_stat s;
| ^
./pcap-bpf.c:1161:19: error: 'BIOCGSTATS' undeclared (first use in this function)
1161 | if (ioctl(p->fd, BIOCGSTATS, (caddr_t)&s) < 0) {
| ^~~~~~~~~~
./pcap-bpf.c:1146:18: error: unused variable 's' [-Werror=unused-variable]
1146 | struct bpf_stat s;
| ^
./pcap-bpf.c: In function 'pcap_read_bpf':
./pcap-bpf.c:1354:15: error: invalid use of undefined type 'struct bpf_hdr'
1354 | caplen = bhp->bh_caplen;
| ^~
./pcap-bpf.c:1355:15: error: invalid use of undefined type 'struct bpf_hdr'
1355 | hdrlen = bhp->bh_hdrlen;
| ^~
./pcap-bpf.c:1371:48: error: invalid use of undefined type 'struct bpf_hdr'
1371 | pcap_filter(p->fcode.bf_insns, datap, bhp->bh_datalen, caplen)) {
| ^~
./pcap-bpf.c:1392:26: error: invalid use of undefined type 'struct bpf_hdr'
1392 | pkthdr.ts.tv_sec = bhp->bh_tstamp.tv_sec;
| ^~
./pcap-bpf.c:1398:27: error: invalid use of undefined type 'struct bpf_hdr'
1398 | pkthdr.ts.tv_usec = bhp->bh_tstamp.tv_usec/1000;
| ^~
./pcap-bpf.c:1415:20: error: invalid use of undefined type 'struct bpf_hdr'
1415 | pkthdr.len = bhp->bh_datalen;
| ^~
./pcap-bpf.c: In function 'bpf_load':
./pcap-bpf.c:1555:20: error: storage size of 'cfg_bpf' isn't known
1555 | struct bpf_config cfg_bpf;
| ^~~~~~~
./pcap-bpf.c:1555:20: error: unused variable 'cfg_bpf' [-Werror=unused-variable]
./pcap-bpf.c: In function 'pcap_activate_bpf':
./pcap-bpf.c:1880:21: error: storage size of 'bv' isn't known
1880 | struct bpf_version bv;
| ^~
./pcap-bpf.c:1913:16: error: 'BIOCVERSION' undeclared (first use in this function)
1913 | if (ioctl(fd, BIOCVERSION, (caddr_t)&bv) < 0) {
| ^~~~~~~~~~~
./pcap-bpf.c:1919:21: error: 'BPF_MAJOR_VERSION' undeclared (first use in this function)
1919 | if (bv.bv_major != BPF_MAJOR_VERSION ||
| ^~~~~~~~~~~~~~~~~
./pcap-bpf.c:1920:20: error: 'BPF_MINOR_VERSION' undeclared (first use in this function)
1920 | bv.bv_minor < BPF_MINOR_VERSION) {
| ^~~~~~~~~~~~~~~~~
./pcap-bpf.c:2206:18: error: 'BIOCSBLEN' undeclared (first use in this function)
2206 | if (ioctl(fd, BIOCSBLEN,
| ^~~~~~~~~
./pcap-bpf.c:2247:19: error: 'BIOCGBLEN' undeclared (first use in this function)
2247 | if ((ioctl(fd, BIOCGBLEN, (caddr_t)&v) < 0) ||
| ^~~~~~~~~
./pcap-bpf.c:2293:16: error: 'BIOCGDLT' undeclared (first use in this function)
2293 | if (ioctl(fd, BIOCGDLT, (caddr_t)&v) < 0) {
| ^~~~~~~~
./pcap-bpf.c:2591:21: error: 'BIOCSRTIMEOUT' undeclared (first use in this function)
2591 | if (ioctl(p->fd, BIOCSRTIMEOUT, (caddr_t)&to) < 0) {
| ^~~~~~~~~~~~~
./pcap-bpf.c:2648:20: error: 'BIOCPROMISC' undeclared (first use in this function)
2648 | if (ioctl(p->fd, BIOCPROMISC, NULL) < 0) {
| ^~~~~~~~~~~
./pcap-bpf.c:2707:19: error: 'BIOCSETF' undeclared (first use in this function); did you mean 'TIOCSETC'?
2707 | if (ioctl(p->fd, BIOCSETF, (caddr_t)&total_prog) < 0) {
| ^~~~~~~~
| TIOCSETC
./pcap-bpf.c:1880:21: error: unused variable 'bv' [-Werror=unused-variable]
1880 | struct bpf_version bv;
| ^~
./pcap-bpf.c: In function 'pcap_setfilter_bpf':
./pcap-bpf.c:3441:19: error: 'BIOCSETF' undeclared (first use in this function); did you mean 'TIOCSETC'?
3441 | if (ioctl(p->fd, BIOCSETF, (caddr_t)fp) == 0) {
| ^~~~~~~~
| TIOCSETC
cc1: all warnings being treated as errors
make: *** [Makefile:86: pcap-bpf.o] Error 1
bash-5.1$ gcc --version
gcc (GCC) 10.3.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
bash-5.1$ uname -a
AIX gcc119 3 7 00F9C1964C00 powerpc AIX