Closed barracuda156 closed 3 months ago
Without this fix on 10.6:
Making all in src
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_netcalc/netcalc/work/netcalc-2.1.6/src'
CC netcalc-netcalc.o
CC netcalc-cprintf.o
CC netcalc-output.o
CC netcalc-misc.o
In file included from netcalc.h:35,
from output.c:35:
/usr/include/net/if.h:264: error: field ‘ifru_addr’ has incomplete type
/usr/include/net/if.h:265: error: field ‘ifru_dstaddr’ has incomplete type
/usr/include/net/if.h:266: error: field ‘ifru_broadaddr’ has incomplete type
/usr/include/net/if.h:305: error: field ‘ifra_addr’ has incomplete type
/usr/include/net/if.h:306: error: field ‘ifra_broadaddr’ has incomplete type
/usr/include/net/if.h:307: error: field ‘ifra_mask’ has incomplete type
/usr/include/net/if.h:379: error: field ‘addr’ has incomplete type
/usr/include/net/if.h:380: error: field ‘dstaddr’ has incomplete type
In file included from netcalc.h:35,
from netcalc.c:41:
/usr/include/net/if.h:264: error: field ‘ifru_addr’ has incomplete type
/usr/include/net/if.h:265: error: field ‘ifru_dstaddr’ has incomplete type
/usr/include/net/if.h:266: error: field ‘ifru_broadaddr’ has incomplete type
/usr/include/net/if.h:305: error: field ‘ifra_addr’ has incomplete type
/usr/include/net/if.h:306: error: field ‘ifra_broadaddr’ has incomplete type
/usr/include/net/if.h:307: error: field ‘ifra_mask’ has incomplete type
/usr/include/net/if.h:379: error: field ‘addr’ has incomplete type
/usr/include/net/if.h:380: error: field ‘dstaddr’ has incomplete type
make[2]: *** [netcalc-output.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [netcalc-netcalc.o] Error 1
In file included from netcalc.h:35,
from misc.c:36:
/usr/include/net/if.h:264: error: field ‘ifru_addr’ has incomplete type
/usr/include/net/if.h:265: error: field ‘ifru_dstaddr’ has incomplete type
/usr/include/net/if.h:266: error: field ‘ifru_broadaddr’ has incomplete type
/usr/include/net/if.h:305: error: field ‘ifra_addr’ has incomplete type
/usr/include/net/if.h:306: error: field ‘ifra_broadaddr’ has incomplete type
/usr/include/net/if.h:307: error: field ‘ifra_mask’ has incomplete type
/usr/include/net/if.h:379: error: field ‘addr’ has incomplete type
/usr/include/net/if.h:380: error: field ‘dstaddr’ has incomplete type
make[2]: *** [netcalc-misc.o] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_netcalc/netcalc/work/netcalc-2.1.6/src'
make[1]: *** [all-recursive] Error 1
Once header added, it builds fine:
Making all in src
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_netcalc/netcalc/work/netcalc-2.1.6/src'
CC netcalc-output.o
CC netcalc-netcalc.o
CC netcalc-misc.o
output.c: In function ‘show_network_ranges_v4’:
output.c:39: warning: ‘min’ may be used uninitialized in this function
output.c: In function ‘print_cf_info_v4’:
output.c:115: warning: ‘min’ may be used uninitialized in this function
output.c:115: warning: ‘max’ may be used uninitialized in this function
CCLD netcalc
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_netcalc/netcalc/work/netcalc-2.1.6/src'
Making all in tests
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_netcalc/netcalc/work/netcalc-2.1.6/tests'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_netcalc/netcalc/work/netcalc-2.1.6/tests'
make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_netcalc/netcalc/work/netcalc-2.1.6'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_netcalc/netcalc/work/netcalc-2.1.6'
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_netcalc/netcalc/work/netcalc-2.1.6'
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_net_netcalc/netcalc/work/netcalc-2.1.6'
Nice work 👍
Thanks for merging!
Just released v2.1.7, with a slightly changed #ifdef
for your PR to increase portability and usefulness on other (*BSD) systems.
Fix for macOS: some versions require
sys/socket.h
be included beforenet/if.h
, otherwise build breaks down.