svn commit: r193976 - head/usr.sbin/arp

Dag-Erling Smorgrav des at FreeBSD.org
Thu Jun 11 07:50:37 UTC 2009


Author: des
Date: Thu Jun 11 07:50:36 2009
New Revision: 193976
URL: http://svn.freebsd.org/changeset/base/193976

Log:
  As of sam's r175206, arp builds cleanly at WARNS level 6, but the Makefile
  was never updated.  Also, clean up the macro that caused the warning in the
  first place (no functional changes, just wrapped and reindented).

Modified:
  head/usr.sbin/arp/Makefile
  head/usr.sbin/arp/arp.c

Modified: head/usr.sbin/arp/Makefile
==============================================================================
--- head/usr.sbin/arp/Makefile	Thu Jun 11 07:40:36 2009	(r193975)
+++ head/usr.sbin/arp/Makefile	Thu Jun 11 07:50:36 2009	(r193976)
@@ -4,6 +4,6 @@
 PROG=	arp
 MAN=	arp.4 arp.8
 
-WARNS?=	1
+WARNS?=	6
 
 .include <bsd.prog.mk>

Modified: head/usr.sbin/arp/arp.c
==============================================================================
--- head/usr.sbin/arp/arp.c	Thu Jun 11 07:40:36 2009	(r193975)
+++ head/usr.sbin/arp/arp.c	Thu Jun 11 07:50:36 2009	(r193976)
@@ -721,9 +721,13 @@ rtmsg(int cmd, struct sockaddr_inarp *ds
 	case RTM_GET:
 		rtm->rtm_addrs |= RTA_DST;
 	}
-#define NEXTADDR(w, s) \
-	if ((s) != NULL && rtm->rtm_addrs & (w)) { \
-		bcopy((s), cp, sizeof(*(s))); cp += SA_SIZE(s);}
+#define NEXTADDR(w, s)					   \
+	do {						   \
+		if ((s) != NULL && rtm->rtm_addrs & (w)) { \
+			bcopy((s), cp, sizeof(*(s)));	   \
+			cp += SA_SIZE(s);		   \
+		}					   \
+	} while (0)
 
 	NEXTADDR(RTA_DST, dst);
 	NEXTADDR(RTA_GATEWAY, sdl);


More information about the svn-src-head mailing list