summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2011-12-17 22:32:00 +0000
committerdim <dim@FreeBSD.org>2011-12-17 22:32:00 +0000
commit5cdde91b9aabdcde417226b2979b71469b3d8f46 (patch)
tree5c6e999fc93c1e92efb2dc565e5d3d6baef880bd
parent226b72cf0dff4f0cea0bf5a926dc198713e21f10 (diff)
downloadFreeBSD-src-5cdde91b9aabdcde417226b2979b71469b3d8f46.zip
FreeBSD-src-5cdde91b9aabdcde417226b2979b71469b3d8f46.tar.gz
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
-rw-r--r--usr.bin/netstat/Makefile5
-rw-r--r--usr.bin/netstat/atalk.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/netstat/Makefile b/usr.bin/netstat/Makefile
index ce5cdab..3f7fe9f 100644
--- a/usr.bin/netstat/Makefile
+++ b/usr.bin/netstat/Makefile
@@ -8,6 +8,11 @@ SRCS= if.c inet.c main.c mbuf.c mroute.c netisr.c route.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
diff --git a/usr.bin/netstat/atalk.c b/usr.bin/netstat/atalk.c
index ec40e25..dc1de3f 100644
--- a/usr.bin/netstat/atalk.c
+++ b/usr.bin/netstat/atalk.c
@@ -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;
}
OpenPOWER on IntegriCloud