From: John Marino Date: Mon, 1 Oct 2012 17:32:45 +0000 (+0200) Subject: gcc47 warnings: A few more fixes X-Git-Tag: v3.2.0~38 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/eed9e955cd3447c8c1d62233f093f19e2a0aa68d gcc47 warnings: A few more fixes usr.bin/make pass -fno-address, NO_WERROR=true usr.bin/monitor modified source file usr.bin/netstat modified source file (2) usr.bin/sdpquery WARNS=2, pass -fno-unused-but-set-variable Make has several evaluations that gcc47 believes will always (without exception) evaluate to true or false. Likely gcc47 is not detecting some cases correctly, so -Wno-address was passed to it. However, -Werror overrides it, so NO_WERROR had to be set on this Makefile. The remaining GCC warnings will be left for swildner to handle. The -Werror flag will be suppress for GCC47 until further notice. --- diff --git a/usr.bin/make/Makefile b/usr.bin/make/Makefile index b3ac092f20..489ba4df0c 100644 --- a/usr.bin/make/Makefile +++ b/usr.bin/make/Makefile @@ -10,6 +10,10 @@ SRCS= arch.c buf.c cond.c dir.c for.c hash.c hash_tables.c job.c \ lst.c main.c make.c parse.c proc.c shell.c str.c suff.c targ.c \ util.c var.c +# For arch.c:400 "evaluation always false" error which seems misdetected +NO_WERROR= yes +CFLAGS+= -Wno-address + NOSHARED?= YES CFLAGS+=-DMAKE_VERSION=\"5200408120\" diff --git a/usr.bin/monitor/monitor.c b/usr.bin/monitor/monitor.c index 630c26a40c..bb438dc8f7 100644 --- a/usr.bin/monitor/monitor.c +++ b/usr.bin/monitor/monitor.c @@ -122,7 +122,7 @@ monitor_add(const char *path) { monitor_elm_t elm; struct kevent kev; - int n; + int __unused n; elm = malloc(sizeof(*elm)); bzero(elm, sizeof(*elm)); diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c index d49fcea3e1..f6abe61421 100644 --- a/usr.bin/netstat/if.c +++ b/usr.bin/netstat/if.c @@ -118,7 +118,6 @@ intpr(int interval1, u_long ifnetaddr, void (*pfunc)(char *)) u_long ifaddraddr; u_long ifaddrcont_addr; u_long ifaddrfound; - u_long ifnetfound; u_long opackets; u_long ipackets; u_long obytes; @@ -177,7 +176,6 @@ intpr(int interval1, u_long ifnetaddr, void (*pfunc)(char *)) if (ifaddraddr == 0) { struct ifaddrhead head; - ifnetfound = ifnetaddr; if (kread(ifnetaddr, (char *)&ifnet, sizeof ifnet)) return; strlcpy(name, ifnet.if_xname, sizeof(name)); diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c index 818b81dc5d..97cf5ccb6c 100644 --- a/usr.bin/netstat/route.c +++ b/usr.bin/netstat/route.c @@ -1144,11 +1144,8 @@ ipx_phost(struct sockaddr *sa) struct sockaddr_ipx work; static union ipx_net ipx_zeronet; char *p; - struct ipx_addr in; work = *sipx; - in = work.sipx_addr; - work.sipx_addr.x_port = 0; work.sipx_addr.x_net = ipx_zeronet; p = ipx_print((struct sockaddr *)&work); diff --git a/usr.bin/sdpquery/Makefile b/usr.bin/sdpquery/Makefile index d138f58dca..f4a7095608 100644 --- a/usr.bin/sdpquery/Makefile +++ b/usr.bin/sdpquery/Makefile @@ -1,5 +1,4 @@ # $NetBSD: Makefile,v 1.3 2007/05/28 12:06:31 tls Exp $ -# $DragonFly: src/usr.bin/sdpquery/Makefile,v 1.1 2008/02/08 14:06:25 hasso Exp $ PROG= sdpquery MAN= sdpquery.1 @@ -9,4 +8,8 @@ CFLAGS+= -I${.CURDIR}/../../sys DPADD+= ${LIBBLUETOOTH} ${LIBSDP} LDADD+= -lbluetooth -lsdp +# suppress cast-qual errors +WARNS?= 3 +CFLAGS+= -Wno-unused-but-set-variable + .include