svn commit: r228668 - head/usr.bin/netstat

Dimitry Andric dim at FreeBSD.org
Sat Dec 17 22:32:01 UTC 2011


Author: dim
Date: Sat Dec 17 22:32:00 2011
New Revision: 228668
URL: http://svn.freebsd.org/changeset/base/228668

Log:
  Revert r228650, and work around the clang false positive with printf
  formats in usr.bin/netstat/atalk.c by conditionally adding NO_WFORMAT to
  the Makefile instead.
  
  MFC after:	1 week

Modified:
  head/usr.bin/netstat/Makefile
  head/usr.bin/netstat/atalk.c

Modified: head/usr.bin/netstat/Makefile
==============================================================================
--- head/usr.bin/netstat/Makefile	Sat Dec 17 22:20:46 2011	(r228667)
+++ head/usr.bin/netstat/Makefile	Sat Dec 17 22:32:00 2011	(r228668)
@@ -8,6 +8,11 @@ SRCS=	if.c inet.c main.c mbuf.c mroute.c
 	unix.c atalk.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c
 
 WARNS?=	3
+.if ${CC:T:Mclang} == "clang"
+# XXX: Work around a clang false positive with format string warnings
+# and ntohs macros (see LLVM PR 11313).
+NO_WFORMAT=
+.endif
 CFLAGS+=-fno-strict-aliasing
 
 CFLAGS+=-DIPSEC

Modified: head/usr.bin/netstat/atalk.c
==============================================================================
--- head/usr.bin/netstat/atalk.c	Sat Dec 17 22:20:46 2011	(r228667)
+++ head/usr.bin/netstat/atalk.c	Sat Dec 17 22:32:00 2011	(r228668)
@@ -81,7 +81,7 @@ static	char mybuf[50];
 			return("*");
 		}
 	}
-	sprintf(mybuf,"%hu",(short)ntohs(sat->sat_addr.s_net));
+	sprintf(mybuf,"%hu",ntohs(sat->sat_addr.s_net));
 	return mybuf;
 }
 


More information about the svn-src-head mailing list