Attention is currently required from: plaisthos.
Hello plaisthos,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1241?usp=email
to review the following change.
Change subject: dhcp: Fix conversion warnings
......................................................................
dhcp: Fix conversion warnings
- Use correct type for pointer difference
- Make sure that small sizeof sum is treated as int
Change-Id: Ie0c0fbf4f7f8b379d46b6755c4eff209acc20fef
Signed-off-by: Frank Lichtenheld <[email protected]>
---
M src/openvpn/dhcp.c
1 file changed, 2 insertions(+), 11 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/41/1241/1
diff --git a/src/openvpn/dhcp.c b/src/openvpn/dhcp.c
index 38e8d40..850a4b6 100644
--- a/src/openvpn/dhcp.c
+++ b/src/openvpn/dhcp.c
@@ -72,11 +72,6 @@
return -1;
}
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversion"
-#endif
-
static in_addr_t
do_extract(struct dhcp *dhcp, int optlen)
{
@@ -115,7 +110,7 @@
const int owlen = len + 2; /* len of data to overwrite
*/
uint8_t *src = dest + owlen;
uint8_t *end = p + optlen;
- const int movlen = end - src;
+ const intptr_t movlen = end - src;
if (movlen > 0)
{
memmove(dest, src, movlen); /* overwrite
router option */
@@ -155,7 +150,7 @@
struct dhcp_full *df = (struct dhcp_full *)BPTR(ipbuf);
const int optlen =
BLEN(ipbuf)
- - (sizeof(struct openvpn_iphdr) + sizeof(struct openvpn_udphdr) +
sizeof(struct dhcp));
+ - (int)(sizeof(struct openvpn_iphdr) + sizeof(struct openvpn_udphdr) +
sizeof(struct dhcp));
if (optlen >= 0 && df->ip.protocol == OPENVPN_IPPROTO_UDP
&& df->udp.source == htons(BOOTPS_PORT) && df->udp.dest ==
htons(BOOTPC_PORT)
@@ -190,7 +185,3 @@
}
return 0;
}
-
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1241?usp=email
To unsubscribe, or for help writing mail filters, visit
http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie0c0fbf4f7f8b379d46b6755c4eff209acc20fef
Gerrit-Change-Number: 1241
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]>
Gerrit-Reviewer: plaisthos <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel