From: Roy Marples Date: Mon, 9 Jan 2023 10:09:45 +0000 (+0000) Subject: linux: Fix compile warning using clang X-Git-Tag: v10.0.0~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01b9b37dd889b5b129718ffa2b8d3ac6a80b15c5;p=thirdparty%2Fdhcpcd.git linux: Fix compile warning using clang --- diff --git a/src/privsep-root.c b/src/privsep-root.c index 5fda1626..db445ec4 100644 --- a/src/privsep-root.c +++ b/src/privsep-root.c @@ -1110,17 +1110,17 @@ ps_root_getifaddrs(struct dhcpcd_ctx *ctx, struct ifaddrs **ifahead) len -= ALIGN(sizeof(*ifa)) + ALIGN(IFNAMSIZ) + ALIGN(sizeof(salen) * IFA_NADDRS); -#define COPYOUTSA(addr) \ - do { \ - memcpy(&salen, sap, sizeof(salen)); \ - if (len < salen) \ - goto err; \ - if (salen != 0) { \ - (addr) = (struct sockaddr *)bp; \ - bp += ALIGN(salen); \ - len -= ALIGN(salen); \ - } \ - sap += sizeof(salen); \ +#define COPYOUTSA(addr) \ + do { \ + memcpy(&salen, sap, sizeof(salen)); \ + if (len < salen) \ + goto err; \ + if (salen != 0) { \ + (addr) = (struct sockaddr *)(void *)bp; \ + bp += ALIGN(salen); \ + len -= ALIGN(salen); \ + } \ + sap += sizeof(salen); \ } while (0 /* CONSTCOND */) COPYOUTSA(ifa->ifa_addr);