From be5d11dcb097571db64903b38f182897c2c55442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Thu, 11 Jun 2009 07:50:36 +0000 Subject: [PATCH] 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). --- usr.sbin/arp/Makefile | 2 +- usr.sbin/arp/arp.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/usr.sbin/arp/Makefile b/usr.sbin/arp/Makefile index ea1c507debc7..829367a770ff 100644 --- a/usr.sbin/arp/Makefile +++ b/usr.sbin/arp/Makefile @@ -4,6 +4,6 @@ PROG= arp MAN= arp.4 arp.8 -WARNS?= 1 +WARNS?= 6 .include diff --git a/usr.sbin/arp/arp.c b/usr.sbin/arp/arp.c index f99cf0f89350..e585ba0fecd9 100644 --- a/usr.sbin/arp/arp.c +++ b/usr.sbin/arp/arp.c @@ -721,9 +721,13 @@ rtmsg(int cmd, struct sockaddr_inarp *dst, struct sockaddr_dl *sdl) 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);