Date: Sun, 20 Apr 1997 04:20:02 -0700 (PDT) From: Bruce Evans <bde@zeta.org.au> To: freebsd-bugs Subject: Re: i386/3353: NTOHS(x) related compiler warnings and libpcap disfunction Message-ID: <199704201120.EAA16242@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR i386/3353; it has been noted by GNATS. From: Bruce Evans <bde@zeta.org.au> To: FreeBSD-gnats-submit@freebsd.org, skynyrd@opus.cts.cwu.edu Cc: Subject: Re: i386/3353: NTOHS(x) related compiler warnings and libpcap disfunction Date: Sun, 20 Apr 1997 21:11:49 +1000 >tcpdump(1) does not correctly process target ports for monitoring which are >specified symbolically on the command line. Given the command line: >... >tcpdump relies on pcap(3) to call getservbyname(), and coincidentally >interesting compilation warnings are issued when libpcap is built >during make world: > >/usr/src/lib/libpcap/../../contrib/libpcap/nametoaddr.c: > In function `pcap_nametoaddr': >/usr/src/lib/libpcap/../../contrib/libpcap/nametoaddr.c:89: > warning: statement with no effect The bugs are that /usr/src/lib/libpcap/Makefile puts `-Dlint' in CFLAGS, and endian.h has broken ifdefs involving lint in -current (was broken in rev.1.14). The Makefile has excessive -Wall flags and -Dlint is a wrong fix for them. The Makefile also has bogus -I flags. There are no sources in ${.CURDIR} except when ${.CURDIR} is the object directory, and this case is handled by `-I.'. The sources are in ${PCAP_DISTDIR}, etc. >cc -E -c ../../contrib/libpcap/nametoaddr.c yields this >(ostensibly correct per endian.h) expansion for line 125: > > (( sp->s_port ) = > __extension__ ({ register u_short __X = ( (u_short)( sp->s_port ) ); > __asm ("xchgb %h1, %b1" > : "=q" (__X) > : "0" (__X)); > __X; }) ) ; You have to compile with the same CFLAGS as the Makefile to see the problem. CFLAGS is too long to type for contrib'ed sources :-(. I will fix endian.h. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704201120.EAA16242>