Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jun 2009 07:50:36 +0000 (UTC)
From:      Dag-Erling Smorgrav <des@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r193976 - head/usr.sbin/arp
Message-ID:  <200906110750.n5B7oaah039573@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906110750.n5B7oaah039573>