From 5cdde91b9aabdcde417226b2979b71469b3d8f46 Mon Sep 17 00:00:00 2001 From: dim Date: Sat, 17 Dec 2011 22:32:00 +0000 Subject: 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 --- usr.bin/netstat/Makefile | 5 +++++ usr.bin/netstat/atalk.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'usr.bin') 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; } -- cgit v1.1